Skip to content
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-12257][SQL] Non partitioned insert into a partitioned Hive table doesn't fail #10254

Closed
wants to merge 2 commits into from

Conversation

dilipbiswal
Copy link
Contributor

Added a check and raise error on missing partition values.

Currently the check is very similar to hive.

@cloud-fan
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Dec 10, 2015

Test build #47494 has finished for PR 10254 at commit 1c0caf7.

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

@@ -155,6 +155,11 @@ case class InsertIntoHiveTable(
val partitionColumns = fileSinkConf.getTableInfo.getProperties.getProperty("partition_columns")
val partitionColumnNames = Option(partitionColumns).map(_.split("/")).orNull

// Validate that partition values are specified for partition columns.
if (partitionColumnNames != null && partitionColumnNames.size > 0 && partitionSpec.size == 0) {
throw new SparkException(ErrorMsg.NEED_PARTITION_ERROR.getMsg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnalysisException for anything that is thrown due to an invalid query.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marmbrus Thanks. Actually right after the code block i changed, there are a few places where we raise SparkException. So i thought there may be a reason for it and followed it. :-). I will change all those places as well.

@SparkQA
Copy link

SparkQA commented Dec 11, 2015

Test build #47553 has finished for PR 10254 at commit f066678.

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

@dilipbiswal
Copy link
Contributor Author

@marmbrus Michael, have implemented your comments. Can you please take a look when you get a chance ?

@marmbrus
Copy link
Contributor

@yhuai could you look at this?

@rxin
Copy link
Contributor

rxin commented Jun 15, 2016

Thanks for the pull request. I'm going through a list of pull requests to cut them down since the sheer number is breaking some of the tooling we have. Since most of the code in this part has been rewritten, I'm going to push a commit to close it. Feel free to reopen it or create a new one.

@asfgit asfgit closed this in 1a33f2e Jun 15, 2016
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