-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Core: Fix partition field IDs in table replacement #2906
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
Core: Fix partition field IDs in table replacement #2906
Conversation
52e4a9f to
15fa6a2
Compare
9f0b54b to
fdba13b
Compare
…alent fields when refreshing spec
Co-authored-by: Jun He <[email protected]>
fdba13b to
f996bff
Compare
jackye1995
left a comment
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.
Looks good to me. The failed Hive tests seem to be wrong, so we can just fix those tests.
f996bff to
15c233e
Compare
|
Thanks for reviewing, @jackye1995! I'm updating the tests as this catches more. It's just a few places that were changed by the behavior fix. |
jun-he
left a comment
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, thanks @rdblue !
|
Late +1 from me too. |
This fixes partition field ID assignment for
REPLACE TABLEoperations. Table replacement callsTableMetadata.buildReplacementthat is responsible for merging the existing table's metadata with table metadata passed to theCREATE OR REPLACE TABLEDDL. When the schema and partition spec are created in this path, the field IDs from the table are not known, so the spec and schema's IDs are consistent but reuse IDs that are already assigned in the table. Schema field IDs are already reassigned, but partition field IDs were conflicting up until now.This reassigns partition field IDs by first reusing existing IDs in the table and then by assigning new IDs.
Addresses this comment: #2089 (comment)
This is based on #2284. I've added Jun as a co-author in the commit. Thanks @jun-he!
Closes #2284.