Skip to content

Conversation

@WangTaoTheTonic
Copy link
Contributor

@WangTaoTheTonic WangTaoTheTonic commented May 31, 2016

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: ...... ".

@SparkQA
Copy link

SparkQA commented May 31, 2016

Test build #59650 has finished for PR 13409 at commit ca269a4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

val columnsCnt = tableDesc.getProperties.getProperty("columns").split(",").size

if (columnsCnt + numDynamicPartitions != child.output.size) {
throw new SparkException(ErrorMsg.TARGET_TABLE_COLUMN_MISMATCH.getMsg)
Copy link
Contributor

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

@SparkQA
Copy link

SparkQA commented May 31, 2016

Test build #59659 has finished for PR 13409 at commit c46e5d0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@WangTaoTheTonic
Copy link
Contributor Author

retest this please.

@SparkQA
Copy link

SparkQA commented Jun 1, 2016

Test build #59708 has finished for PR 13409 at commit c46e5d0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@WangTaoTheTonic
Copy link
Contributor Author

cc @liancheng @andrewor14 Could you please review this? Thanks!

@SparkQA
Copy link

SparkQA commented Jul 3, 2016

Test build #61688 has finished for PR 13409 at commit 50977da.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 13, 2016

Test build #62200 has finished for PR 13409 at commit 50977da.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@WangTaoTheTonic
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Aug 12, 2016

Test build #63653 has finished for PR 13409 at commit 50977da.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor

I think this might be subsumed by @cloud-fan's #13754; can you confirm?

@cloud-fan
Copy link
Contributor

yea, it's fixed. @WangTaoTheTonic can you close this PR? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants