-
Notifications
You must be signed in to change notification settings - Fork 260
Add support for evolving a partition column #1334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1b10b21
to
e71b0bb
Compare
e71b0bb
to
9a9174e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
should we also add the same for timestamp
, timestamp_ns
, and decimal
?
just to complete all lines in this table https://iceberg.apache.org/spec/#schema-evolution
# Create a table, and do some evolution on a partition column | ||
spark.sql("CREATE OR REPLACE TABLE rest.default.test_promote_column (foo int) USING iceberg PARTITIONED BY (foo)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit I think we should keep the original test and just create another table for evolution on a partition column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -403,12 +403,26 @@ impl Datum { | |||
} | |||
} | |||
PrimitiveType::Int => PrimitiveLiteral::Int(i32::from_le_bytes(bytes.try_into()?)), | |||
PrimitiveType::Long => PrimitiveLiteral::Long(i64::from_le_bytes(bytes.try_into()?)), | |||
PrimitiveType::Long => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant section from the spec: https://iceberg.apache.org/spec/#schema-evolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I first did only the V2 transformations for now. I've added a test for the float and decimal case as well 👍 Decimal works with the current code since we don't have a fixed number of bytes in contrast to int/long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Looks like we need to run cargo fmt
Which issue does this PR close?
To check what happens if a partition column is evolved.
What changes are included in this PR?
Are these changes tested?