-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-42684][SQL] v2 catalog should not allow column default value by default #40299
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
Conversation
gengliangwang
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.
+1, LGTM
dtenedor
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.
This is a good safeguard for correctness.
| ident: Identifier): Unit = { | ||
| if (SQLConf.get.enableDefaultColumns && | ||
| schema.exists(_.metadata.contains(CURRENT_DEFAULT_COLUMN_METADATA_KEY))) { | ||
| if (!catalog.capabilities().contains( |
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.
We can combine with the previous if statement using &&?
|
thanks for review, merging to master/3.4! |
…y default ### What changes were proposed in this pull request? Following generated columns, column default value should also have a catalog capability and v2 catalogs must explicitly declare SUPPORT_COLUMN_DEFAULT_VALUE to support it. ### Why are the changes needed? column default value needs dedicated handling and if a catalog simply ignores it, then query result can be wrong. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? new tests Closes #40299 from cloud-fan/default. Authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 69dd20b) Signed-off-by: Wenchen Fan <[email protected]>
…y default ### What changes were proposed in this pull request? Following generated columns, column default value should also have a catalog capability and v2 catalogs must explicitly declare SUPPORT_COLUMN_DEFAULT_VALUE to support it. ### Why are the changes needed? column default value needs dedicated handling and if a catalog simply ignores it, then query result can be wrong. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? new tests Closes apache#40299 from cloud-fan/default. Authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 69dd20b) Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
Following generated columns, column default value should also have a catalog capability and v2 catalogs must explicitly declare SUPPORT_COLUMN_DEFAULT_VALUE to support it.
Why are the changes needed?
column default value needs dedicated handling and if a catalog simply ignores it, then query result can be wrong.
Does this PR introduce any user-facing change?
No
How was this patch tested?
new tests