Repository navigation
[core] Preserve and protect generated-column metadata - #1447
Open
SteNicholas wants to merge 1 commit into
Open
SteNicholas wants to merge 1 commit into
SteNicholas wants to merge 1 commit into
Conversation
SteNicholas
force-pushed
the
PAIMON-1442
branch
2 times, most recently
from
November 18, 2026 05:56
c15fca1 to
110389f
Compare
JingsongLi
reviewed
Nov 18, 2026
SteNicholas
force-pushed
the
PAIMON-1442
branch
from
November 18, 2026 06:35
110389f to
ef1ed0d
Compare
Preserve Java's optional generationExpression in schema JSON and through field copies, schema builders, Arrow conversion and read/write projections. Expose stored expressions in the Python DataField wrapper. Validate generated-column evolution against final fields by stable ID, after nullability normalization. Reject changes to generated columns or their dependencies and new generated columns after table creation. Reject structural changes conservatively when dependencies cannot be resolved. Apply generated-column constraints during CREATE and ALTER: reject nested generated columns, generated columns with defaults and generated columns used as rowkind.field. Reuse write-time default parsing to validate retained defaults before publishing type changes. Cover metadata round-trips, rejected changes without schema publication, and reads of stored generated values, including NULL. Document that writers must supply generated values; expression evaluation and SQL GENERATED ALWAYS AS authoring remain unsupported.
SteNicholas
force-pushed
the
PAIMON-1442
branch
from
November 18, 2026 08:50
ef1ed0d to
df404cc
Compare
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.
Purpose
Linked issue: #1442
Loading a Java schema discarded
generationExpression. Rewriting that schema could erase generated-column definitions and permit changes that invalidate stored values. Preserve this metadata throughout Rust schema handling and reject incompatible schema changes before publishing a new version.Brief change log
generationExpressioninDataField, field copies, schema builders, Arrow conversion, read/write projections and Map/Variant transformations. Expose stored expressions through the PythonDataFieldwrapper and retain them during DataFusion Variant pushdown.rowkind.field.BIGINT DEFAULT 2147483648toINTnow fails without publishing an unusable schema.Tests
Local validation passed: 212 schema, generated-column, default-parser and filesystem catalog tests; the expanded primary-key metadata test;
cargo +1.98.0 fmt --all -- --check; andcargo +1.98.0 clippy --locked --all-targets --workspace --features vortex -- -D warnings.API and Format
Add Rust
DataField::generation_expression(),with_generation_expression(...),with_data_type(...)andSchemaBuilder::field(...), plus PythonDataField.generation_expression(). Schema JSON retains Java's optionalgenerationExpression; absent and null values serialize without the property. Arrow fields carry expressions underpaimon:generationExpression. Data file layouts are unchanged.Documentation
Document the metadata representation, APIs, schema-evolution rules and Java-compatible constraints in
docs/src/getting-started.md. Writers must supply generated values explicitly. Expression evaluation and SQLGENERATED ALWAYS ASauthoring remain unsupported.🤖 Assisted with Codex.