Conversation
This branch has not been deployed
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.
Do not merge before #9485, the format specification this implements, is voted and merged. Stacked on #9494.
Tables created before the semantic type contract of #7073, and every table on data storage 2.2 or earlier, stay legacy tables: they reject appends in another layout and cannot use output encodings. This adds the explicit upgrade the design calls for.
Dataset::migrate_to_semantic_types()commits one metadata-only version. It rewrites each legacy alias to its canonical type with the output encoding that keeps the current read type (large_stringbecomesstringwithlarge_utf8,decimal:256:10:2becomesdecimal:10:2withdecimal256), and setsFLAG_SEMANTIC_TYPES. No data file is rewritten. Reads return the same Arrow types, values, and field IDs, and appends then accept any layout of a column's type. It is idempotent, there is no downgrade, and restoring an earlier version keeps the flag. Python exposesLanceDataset.migrate_to_semantic_types()and JavaDataset.migrateToSemanticTypes().The migration refuses, and commits nothing, in three cases:
lance-schema:output-encodingentry. Legacy tables ignore it, so adopting it would change what reads return.The commit follows
migrate_to_stable_row_ids: it projects the current schema with a commit option that sets the flag, and it does not retry past a concurrent write. This keeps the transaction format unchanged.