-
- Downloads
[SPARK-18949][SQL][BACKPORT-2.1] Add recoverPartitions API to Catalog
### What changes were proposed in this pull request? This PR is to backport https://github.com/apache/spark/pull/16356 to Spark 2.1.1 branch. ---- Currently, we only have a SQL interface for recovering all the partitions in the directory of a table and update the catalog. `MSCK REPAIR TABLE` or `ALTER TABLE table RECOVER PARTITIONS`. (Actually, very hard for me to remember `MSCK` and have no clue what it means) After the new "Scalable Partition Handling", the table repair becomes much more important for making visible the data in the created data source partitioned table. Thus, this PR is to add it into the Catalog interface. After this PR, users can repair the table by ```Scala spark.catalog.recoverPartitions("testTable") ``` ### How was this patch tested? Modified the existing test cases. Author: gatorsmile <gatorsmile@gmail.com> Closes #16372 from gatorsmile/repairTable2.1.1.
Showing
- project/MimaExcludes.scala 4 additions, 1 deletionproject/MimaExcludes.scala
- python/pyspark/sql/catalog.py 5 additions, 0 deletionspython/pyspark/sql/catalog.py
- sql/core/src/main/scala/org/apache/spark/sql/catalog/Catalog.scala 7 additions, 0 deletions...src/main/scala/org/apache/spark/sql/catalog/Catalog.scala
- sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala 14 additions, 0 deletions...ain/scala/org/apache/spark/sql/internal/CatalogImpl.scala
- sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionProviderCompatibilitySuite.scala 3 additions, 3 deletions.../spark/sql/hive/PartitionProviderCompatibilitySuite.scala
Loading
Please register or sign in to comment