-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-44577][SQL] Fix INSERT BY NAME returns nonsensical error message #42220
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
[SPARK-44577][SQL] Fix INSERT BY NAME returns nonsensical error message #42220
Conversation
|
cc @cloud-fan |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala
Show resolved
Hide resolved
|
can we update the PR description for the new changes? |
Done |
For by-name insert, shall we just say "incompatible data columns"? The number of columns does match here. |
Oh, let me align v1 and v2 errors. |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala
Outdated
Show resolved
Hide resolved
|
@MaxGekk does this PR align with your plan of unifying the assignment errors? |
|
@cloud-fan In my PR #42393, I am going to touch non- |
|
Hi @cloud-fan @MaxGekk Shall we continue push on this PR? Thanks. |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala
Outdated
Show resolved
Hide resolved
| }, | ||
| "EXTRA_FIELDS" : { | ||
| "message" : [ | ||
| "Cannot write extra fields <colName>." |
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.
it's one column or multiple 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.
multiple columns, so I do some change, please check it again. Thanks.
|
thanks, merging to master/3.5! |
### What changes were proposed in this pull request? Fix INSERT BY NAME returns nonsensical error message on v1 datasource. eg: ```scala CREATE TABLE bug(c1 INT); INSERT INTO bug BY NAME SELECT 1 AS c2; ==> Multi-part identifier cannot be empty. ``` After PR: ```scala [INCOMPATIBLE_DATA_FOR_TABLE.CANNOT_FIND_DATA] Cannot write incompatible data for the table `spark_catalog`.`default`.`bug`: Cannot find data for the output column `c1`. ``` Also fixed the same issue when throwing other INCOMPATIBLE_DATA_FOR_TABLE type errors ### Why are the changes needed? Fix the error msg nonsensical. ### Does this PR introduce _any_ user-facing change? Yes, the error msg in v1 insert by name will be changed. ### How was this patch tested? add new test. Closes #42220 from Hisoka-X/SPARK-44577_insert_by_name_bug_fix. Authored-by: Jia Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 00f6699) Signed-off-by: Wenchen Fan <[email protected]>
|
Thanks @cloud-fan and @MaxGekk |
What changes were proposed in this pull request?
Fix INSERT BY NAME returns nonsensical error message on v1 datasource.
eg:
After PR:
Also fixed the same issue when throwing other INCOMPATIBLE_DATA_FOR_TABLE type errors
Why are the changes needed?
Fix the error msg nonsensical.
Does this PR introduce any user-facing change?
Yes, the error msg in v1 insert by name will be changed.
How was this patch tested?
add new test.