-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[SPARK-51726][SQL] Use TableInfo for Stage CREATE/REPLACE/CREATE OR REPLACE table #50521
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
Conversation
f5d87e7
to
b3862da
Compare
Transform[] partitions, | ||
Map<String, String> properties) throws TableAlreadyExistsException, NoSuchNamespaceException { | ||
return stageCreate(ident, CatalogV2Util.v2ColumnsToStructType(columns), partitions, properties); | ||
default StagedTable stageCreate(Identifier ident, TableInfo tableInfo) |
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.
Optional: My personal preference would be to format it this way:
default StagedTable stageCreate(
Identifier ident,
TableInfo tableInfo) throws TableAlreadyExistsException, NoSuchNamespaceException {
...
}
Transform[] partitions, | ||
Map<String, String> properties) throws NoSuchNamespaceException, NoSuchTableException { | ||
return stageReplace( | ||
ident, CatalogV2Util.v2ColumnsToStructType(columns), partitions, properties); |
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.
Optional: What about putting each argument on a separate line?
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 seems consistent with existing code in this file
Map<String, String> properties) throws NoSuchNamespaceException, NoSuchTableException { | ||
return stageReplace( | ||
ident, CatalogV2Util.v2ColumnsToStructType(columns), partitions, properties); | ||
default StagedTable stageReplace(Identifier ident, TableInfo tableInfo) |
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.
Optional: Same comment about formatting as in create.
Map<String, String> properties) throws NoSuchNamespaceException { | ||
return stageCreateOrReplace( | ||
ident, CatalogV2Util.v2ColumnsToStructType(columns), partitions, properties); | ||
default StagedTable stageCreateOrReplace(Identifier ident, TableInfo tableInfo) |
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.
Here too, method + invocation.
What changes were proposed in this pull request?
Followup of #50137 for the table replace methods in StagingTableCatalog.
Why are the changes needed?
To make it easier to add new parameters such as constraints.
Does this PR introduce any user-facing change?
Yes, but backwards compatible by providing a default implementation.
How was this patch tested?
Existing tests
Was this patch authored or co-authored using generative AI tooling?
No