Skip to content

Conversation

@gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented Jan 1, 2017

What changes were proposed in this pull request?

The data in the managed table should be deleted after table is dropped. However, if the partition location is not under the location of the partitioned table, it is not deleted as expected. Users can specify any location for the partition when they adding a partition.

This PR is to delete partition location when dropping managed partitioned tables stored in InMemoryCatalog.

How was this patch tested?

Added test cases for both HiveExternalCatalog and InMemoryCatalog

* Add Partition in ALTER TABLE: add the table partitions.
*
* 'partitionSpecsAndLocs': the syntax of ALTER VIEW is identical to ALTER TABLE,
* EXCEPT that it is ILLEGAL to specify a LOCATION clause.
Copy link
Member Author

Choose a reason for hiding this comment

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

We do not support ALTER VIEW ADD PARTITION

assert(e.message == "Found duplicate column(s) in table definition of `tbl`: a")
}

test("add/drop partition with location - managed table") {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to improve the test coverage of Hive External Catalog.

@SparkQA
Copy link

SparkQA commented Jan 1, 2017

Test build #70776 has finished for PR 16448 at commit 1dc12b3.

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

@gatorsmile
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Jan 2, 2017

Test build #70784 has finished for PR 16448 at commit 1dc12b3.

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

@gatorsmile
Copy link
Member Author

cc @cloud-fan @yhuai

val table = CatalogTable(
identifier = TableIdentifier("tbl", Some("db1")),
tableType = CatalogTableType.MANAGED,
storage = CatalogStorageFormat(None, None, None, None, false, Map.empty),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: CatalogStorageFormat.empty

@cloud-fan
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Jan 3, 2017

Test build #70796 has started for PR 16448 at commit 5441f15.

@cloud-fan
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Jan 3, 2017

Test build #70817 has finished for PR 16448 at commit 5441f15.

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

asfgit pushed a commit that referenced this pull request Jan 3, 2017
…rtitioned Tables in InMemoryCatalog

### What changes were proposed in this pull request?
The data in the managed table should be deleted after table is dropped. However, if the partition location is not under the location of the partitioned table, it is not deleted as expected. Users can specify any location for the partition when they adding a partition.

This PR is to delete partition location when dropping managed partitioned tables stored in `InMemoryCatalog`.

### How was this patch tested?
Added test cases for both HiveExternalCatalog and InMemoryCatalog

Author: gatorsmile <[email protected]>

Closes #16448 from gatorsmile/unsetSerdeProp.

(cherry picked from commit b67b35f)
Signed-off-by: gatorsmile <[email protected]>
@gatorsmile
Copy link
Member Author

Thanks! Merging to master/2.1

@asfgit asfgit closed this in b67b35f Jan 3, 2017
cmonkey pushed a commit to cmonkey/spark that referenced this pull request Jan 4, 2017
…rtitioned Tables in InMemoryCatalog

### What changes were proposed in this pull request?
The data in the managed table should be deleted after table is dropped. However, if the partition location is not under the location of the partitioned table, it is not deleted as expected. Users can specify any location for the partition when they adding a partition.

This PR is to delete partition location when dropping managed partitioned tables stored in `InMemoryCatalog`.

### How was this patch tested?
Added test cases for both HiveExternalCatalog and InMemoryCatalog

Author: gatorsmile <[email protected]>

Closes apache#16448 from gatorsmile/unsetSerdeProp.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…rtitioned Tables in InMemoryCatalog

### What changes were proposed in this pull request?
The data in the managed table should be deleted after table is dropped. However, if the partition location is not under the location of the partitioned table, it is not deleted as expected. Users can specify any location for the partition when they adding a partition.

This PR is to delete partition location when dropping managed partitioned tables stored in `InMemoryCatalog`.

### How was this patch tested?
Added test cases for both HiveExternalCatalog and InMemoryCatalog

Author: gatorsmile <[email protected]>

Closes apache#16448 from gatorsmile/unsetSerdeProp.
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.

3 participants