Lance Table Schema Evolution
A schema describes the structure of a Lance table, including all fields, data types, and metadata. It uses a logical type system that represents data types as strings mapped to Apache Arrow. Each field has a unique identifier (field ID). Fields can be renamed or reordered without breaking references, enabling powerful schema evolution and version tracking. Field IDs ensure that data files can be correctly interpreted even if the schema changes over time. During table creation, field IDs are assigned to all fields in a depth-first order, starting from 0.
- Adding a column: Assign a new field ID and add it to the schema.
- Deleting a column: Remove a field from the schema. Its ID can be reused if it is no longer referenced.
- Renaming a column: Change the field name while retaining the ID.
- Reordering columns: Change the field order in the schema while retaining the IDs.
- Type evolution: Change the data type of a field. This operation may require rewriting the columns in the data, depending on the changed type.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot