Uh oh!
There was an error while loading. Please reload this page.
[SPARK-43742][SQL][FOLLOWUP] Do not use null literal as default value for non-nullable columns - #41656
Closed
cloud-fan wants to merge 5 commits into
Closed
[SPARK-43742][SQL][FOLLOWUP] Do not use null literal as default value for non-nullable columns#41656cloud-fan wants to merge 5 commits into
cloud-fan wants to merge 5 commits into
Conversation
cloud-fan
commented
Jun 19, 2023
| val sql5 = s"UPDATE $tblName SET name=DEFAULT, age=DEFAULT" | ||
| // Note: 'i' and 's' are the names of the columns in 'tblName'. | ||
| val sql6 = s"UPDATE $tblName SET i=DEFAULT, s=DEFAULT" | ||
| val sql7 = s"UPDATE testcat.defaultvalues SET i=DEFAULT, s=DEFAULT" |
ContributorAuthor
There was a problem hiding this comment.
move the tests out of the loop as the table name does not change.
cloud-fan
commented
Jun 19, 2023
| start = 62, | ||
| stop = 68)) | ||
| val sql7 = "UPDATE testcat.tab2 SET x=DEFAULT" |
cloud-fan
commented
Jun 19, 2023
| // DEFAULT column reference in the merge condition: | ||
| // This MERGE INTO command includes an ON clause with a DEFAULT column reference. This | ||
| // DEFAULT column won't be resolved. | ||
| val mergeWithDefaultReferenceInMergeCondition = |
ContributorAuthor
There was a problem hiding this comment.
ditto, move tests out of the loop
cloud-fan
commented
Jun 19, 2023
| errorClass = "_LEGACY_ERROR_TEMP_1343", | ||
| parameters = Map.empty) | ||
| val mergeWithDefaultReferenceForNonNullableCol = |
Uh oh!
There was an error while loading. Please reload this page.
gengliangwang
approved these changes
Jun 20, 2023
Co-authored-by: Gengliang Wang <gengliang@apache.org>
dongjoon-hyun
approved these changes
Jun 20, 2023
dongjoon-hyun
commented
Jun 20, 2023
Member
Could you re-trigger the failed SQL pipeline? |
dongjoon-hyun
commented
Jun 21, 2023
Member
Merged to master. Thank you, @cloud-fan and @gengliangwang . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
A followup of #41262 to fix a mistake. If a column has no default value and is not nullable, we should fail if people want to use its default value via the explicit
DEFAULTname, and do not fill missing columns in INSERT.Why are the changes needed?
fix a wrong behavior
Does this PR introduce any user-facing change?
yes, otherwise the DML command will fail later at runtime.
How was this patch tested?
new tests