Skip to content

Conversation

@windpiger
Copy link
Contributor

@windpiger windpiger commented Feb 24, 2017

What changes were proposed in this pull request?

This JIRA is a follow up work after SPARK-19583

As we discussed in that PR

The following DDL for a managed table with an existed default location should throw an exception:

CREATE TABLE ... (PARTITIONED BY ...) AS SELECT ...
CREATE TABLE ... (PARTITIONED BY ...)

Currently there are some situations which are not consist with above logic:

  1. CREATE TABLE ... (PARTITIONED BY ...) succeed with an existed default location
    situation: for both hive/datasource(with HiveExternalCatalog/InMemoryCatalog)

  2. CREATE TABLE ... (PARTITIONED BY ...) AS SELECT ...
    situation: hive table succeed with an existed default location

This PR is going to make above two situations consist with the logic that it should throw an exception
with an existed default location.

How was this patch tested?

unit test added

test("CTAS for managed data source table with a created default location throw an exception") {
withTable("t", "t1", "t2") {
val warehousePath = spark.sharedState.warehousePath.stripPrefix("file:")
val tFile = new File(warehousePath, "t")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are lots of non-existent default location test cases, so here we just add existed default location test cases

@windpiger windpiger changed the title [SPARK-19724][SQL]create a managed hive table with an existed default location should throw an exception [SPARK-19724][SQL]CTAS for a managed hive table with an existed default location should throw an exception Feb 24, 2017
@SparkQA
Copy link

SparkQA commented Feb 24, 2017

Test build #73421 has finished for PR 17057 at commit 81cf177.

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

@windpiger windpiger changed the title [SPARK-19724][SQL]CTAS for a managed hive table with an existed default location should throw an exception [SPARK-19724][SQL][WIP]CTAS for a managed hive table with an existed default location should throw an exception Feb 24, 2017
@SparkQA
Copy link

SparkQA commented Feb 24, 2017

Test build #73420 has finished for PR 17057 at commit 52f8bcd.

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

@windpiger windpiger changed the title [SPARK-19724][SQL][WIP]CTAS for a managed hive table with an existed default location should throw an exception [SPARK-19724][SQL][WIP]create a managed table with an existed default location should throw an exception Feb 24, 2017
@SparkQA
Copy link

SparkQA commented Feb 24, 2017

Test build #73426 has finished for PR 17057 at commit 7e9d341.

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

@windpiger windpiger changed the title [SPARK-19724][SQL][WIP]create a managed table with an existed default location should throw an exception [SPARK-19724][SQL]create a managed table with an existed default location should throw an exception Feb 24, 2017
@SparkQA
Copy link

SparkQA commented Feb 24, 2017

Test build #73428 has finished for PR 17057 at commit b4c55d6.

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

@SparkQA
Copy link

SparkQA commented Feb 24, 2017

Test build #73429 has finished for PR 17057 at commit a764624.

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

@windpiger windpiger changed the title [SPARK-19724][SQL]create a managed table with an existed default location should throw an exception [SPARK-19724][SQL][WIP]create a managed table with an existed default location should throw an exception Feb 26, 2017
@windpiger windpiger closed this Mar 13, 2017
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.

2 participants