-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-41406][SQL] Refactor error message for NUM_COLUMNS_MISMATCH to make it more generic
#38937
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
|
Can one of the admins verify this patch? |
|
cc @MaxGekk |
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.
hmm, could you output it as EXCEPT ALL
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.
Done
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.
expects matching number of columns -> expect matching numbers of 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.
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.
What is an 'operator' here and can the left always be called the target?
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.
I'm thinking of the operator being UNION (hence left and right).
So:
SET
INSERT
UNION
INTERSECT
EXCEPT
IN (?) -- this may go through struct logic not sure)
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.
I would avoid words like left/right and reference/target, and just slightly improve the existing error template by replacing the word table to let's say input:
"<operator> can only be performed on inputs with the same number of columns, but the first input has <firstNumColumns> columns and the <invalidOrdinalNum> input has <invalidNumColumns> 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.
@panbingkun Could you change the error message, please.
…to make it more generic
…to make it more generic
…to make it more generic
…to make it more generic
fa9fdff to
d41d2e1
Compare
| df1.unionByName(df2) | ||
| }.getMessage | ||
| assert(errMsg.contains("Union can only be performed on tables with" + | ||
| assert(errMsg.contains("UNION can only be performed on tables with" + |
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 it another error class, right?
MaxGekk
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.
Waiting for CI.
|
+1, LGTM. All GAs passed. Merging to master. |
…to make it more generic ### What changes were proposed in this pull request? The pr aims to refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic. ### Why are the changes needed? The changes improve the error framework. ### Does this PR introduce _any_ user-facing change? Yes. ### How was this patch tested? Update existed UT. Pass GA. Closes apache#38937 from panbingkun/SPARK-41406. Authored-by: panbingkun <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
The pr aims to refactor error message for
NUM_COLUMNS_MISMATCHto make it more generic.Why are the changes needed?
The changes improve the error framework.
Does this PR introduce any user-facing change?
Yes.
How was this patch tested?
Update existed UT.
Pass GA.