-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Spark] Support RESTORE for clustered table #3194
Conversation
f2c8b3f
to
f22acc0
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.
Looks good to me. Let's add more tests
verifyClusteringColumns(tableIdentifier, "a") | ||
} | ||
|
||
// Scenario 3: restore unclustered table to clustered version. |
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.
This comment doesn't look right? All versions below are all clustered table. Are you meaning restore from table with clustering columns to non-empty clustering columns
?
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.
Yeah, this is more accurate, updated
@@ -825,6 +826,45 @@ trait ClusteredTableDDLSuiteBase | |||
} | |||
} | |||
|
|||
test("validate RESTORE on clustered table") { |
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.
Is there a column mapping enabled variant for these tests? If not let's add one since column names are maninulated
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.
Sure, added them to column mapping's selected tests.
verifyClusteringColumns(tableIdentifier, "a") | ||
} | ||
} | ||
|
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.
Can we add the following test :
- Restore to latest snapshot: basically it should work for fromSnapshot = toSnapshot
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.
Added
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.
Actually we do a shortcut when fromSnapshot = toSnapshot (src)
So I modified the test to restore to the start version.
bb18a1c
to
4dd0c34
Compare
Support RESTORE for clustered tables by adding a new domain metadata to overwrite the existing one so that clustering columns are correctly restored. New unit tests.
Which Delta project/connector is this regarding?
Description
Support RESTORE for clustered tables by adding a new domain metadata to overwrite the existing one so that clustering columns are correctly restored.
How was this patch tested?
New unit tests.
Does this PR introduce any user-facing changes?
No