-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-15667][SQL]Throw exception if columns number of outputs mismatch the inputs #13409
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
|
Test build #59650 has finished for PR 13409 at commit
|
| val columnsCnt = tableDesc.getProperties.getProperty("columns").split(",").size | ||
|
|
||
| if (columnsCnt + numDynamicPartitions != child.output.size) { | ||
| throw new SparkException(ErrorMsg.TARGET_TABLE_COLUMN_MISMATCH.getMsg) |
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 check only catches cases when number of columns are different. The error message would not be precise as it would say
column number/types are different. - You could also add other info to the exception: table names and column counts
|
Test build #59659 has finished for PR 13409 at commit
|
|
retest this please. |
|
Test build #59708 has finished for PR 13409 at commit
|
|
cc @liancheng @andrewor14 Could you please review this? Thanks! |
|
Test build #61688 has finished for PR 13409 at commit
|
|
Test build #62200 has finished for PR 13409 at commit
|
|
retest this please |
|
Test build #63653 has finished for PR 13409 at commit
|
|
I think this might be subsumed by @cloud-fan's #13754; can you confirm? |
|
yea, it's fixed. @WangTaoTheTonic can you close this PR? thanks! |
What changes were proposed in this pull request?
We will throw exception if the columns number of inputs and outputs mismatch in driver side, instead of ArrayIndexOutOfBoundsException in executor side.
How was this patch tested?
run below sql statements:
create table test(school string,province string,a int);
create table p3(school string,province string);
insert into table test select * from p3;
the driver will throw exception which message will be "Cannot insert into target table _tableName because column number are different: ...... ".