Repository navigation
fix(cypher): keep field metadata on returned properties - #204
Merged
Merged
Conversation
The CSR target and relationship lookups, variable-length path outputs and schema normalisation rebuilt output fields from name, type and nullability, dropping Arrow field metadata such as extension type names. With CSR on, a property returned across a relationship lost, for example, its geoarrow.point tag. Rebuild these fields with Field::with_name so the metadata carries over. Closes #201
Deploying lance-csr with
|
| Latest commit: |
0105fda
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://33db0b4a.lance-csr.pages.dev |
| Branch Preview URL: | https://fix-csr-field-metadata.lance-csr.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With CSR on, a property column returned from a query that crosses a relationship lost its source field's Arrow metadata. The values were right, but extension types such as GeoArrow (
ARROW:extension:name: geoarrow.point) came back as plain lists, structs or binaries, so consumers could no longer recognise them. Single-node queries and the join path kept the metadata.use_csr=Falseherekeepsgeoarrow.pointuse_csr=Trueherehas no metadataherekeepsgeoarrow.pointCloses #201.
What changed
Several places rebuilt output fields from just name, type and nullability, which drops field metadata. They now rename the source field instead, so its metadata carries over:
SqlEngineresults now keep field metadata too.Values and column names don't change. Computed columns (
count(), literals, expressions) still carry no metadata.Validation
returned_properties_keep_field_metadatacovers single-node, one-hop (aliased and not), variable-length and relationship-property queries with CSR on and off. It fails onmainand passes here.geoarrow.pointlist and struct columns, ageoarrow.wkbbinary column and ageoarrow.wkbrelationship column, and checks them in both modes.cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace,make test(1784 passed) andmake lintpass locally.🤖 Generated with Claude Code