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-28800][DOC][SQL] Document REPAIR TABLE statement in SQL Reference #25884

Closed
wants to merge 3 commits into from

Conversation

huaxingao
Copy link
Contributor

@huaxingao huaxingao commented Sep 21, 2019

What changes were proposed in this pull request?

Document REPAIR TABLE statement in SQL Reference.

Why are the changes needed?

To complete SQL reference.

Does this PR introduce any user-facing change?

Yes.

After the change, we will have the following
image

image

How was this patch tested?

Tested using jykyll build --serve

@SparkQA
Copy link

SparkQA commented Sep 21, 2019

Test build #111123 has finished for PR 25884 at commit caec888.

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

@huaxingao
Copy link
Contributor Author

@dilipbiswal @gatorsmile Please review this one too. Thanks!

@@ -19,4 +19,18 @@ license: |
limitations under the License.
---

**This page is under construction**
### Description
`MSCK REPAIR TABLE` recovers all the partitions in the directory of a table and updates the catalog. `MSCK REPAIR TABLE` on a non-existent table or a table without partitions throws Exception. Another way to recover partitions is to use `ALTER TABLE RECOVER PARTITIONS`.
Copy link
Member

Choose a reason for hiding this comment

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

throws Exception -> throws an exception.

Is there anything else we can say about when this would become necessary? when do you need to recover a table, and is there any more to say about what it updates in the catalog / metastore? No need to say a lot, just trying to make this slightly more useful to a reader.

@SparkQA
Copy link

SparkQA commented Oct 5, 2019

Test build #111809 has finished for PR 25884 at commit c81e5d1.

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

@@ -19,4 +19,45 @@ license: |
limitations under the License.
---

**This page is under construction**
### Description
`MSCK REPAIR TABLE` recovers all the partitions in the directory of a table and updates the Hive metastore. When creating a table using `partitoned by` clause, partitions are generated and registered in the Hive metastore. However, if the partitioned table is created from existing data, partitions are not registered automatically in the Hive metastore. User needs to run MSCK REPAIR TABLE to register the partitions. `MSCK REPAIR TABLE` on a non-existent table or a table without partitions throws an exception. Another way to recover partitions is to use `ALTER TABLE RECOVER PARTITIONS`.
Copy link
Member

Choose a reason for hiding this comment

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

(Pardon me if this is duplicated - thought I left this comment but doesn't look like it now.)
Maybe back-tick the last occurrence of "MSCK REPAIR TABLE"?
and maybe partitioned by -> PARTITIONED BY

@SparkQA
Copy link

SparkQA commented Oct 6, 2019

Test build #111819 has finished for PR 25884 at commit 84d12bf.

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

@srowen srowen closed this in 5a512e8 Oct 6, 2019
@srowen
Copy link
Member

srowen commented Oct 6, 2019

Merged to master

@huaxingao
Copy link
Contributor Author

Thanks a lot! @srowen

@huaxingao huaxingao deleted the spark-28800 branch October 6, 2019 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants