Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/626#discussion_r40115745
--- Diff: tajo-docs/src/main/sphinx/sql_language/alter_table.rst ---
@@ -96,4 +96,31 @@ You can use ``ALTER TABLE ADD PARTITION`` to add
partitions to a table. The loca
ALTER TABLE table1 DROP PARTITION (col1 = '2015' , col2 = '01', col3 =
'11' )
ALTER TABLE table1 DROP PARTITION (col1 = 'TAJO' ) PURGE
-You can use ``ALTER TABLE DROP PARTITION`` to drop a partition for a
table. This removes the data for a managed table and this doesn't remove the
data for an external table. But if ``PURGE`` is specified for an external
table, the partition data will be removed. The metadata is completely lost in
all cases. An error is thrown if the partition for the table doesn't exists.
You can use ``IF EXISTS`` to skip the error.
+You can use ``ALTER TABLE DROP PARTITION`` to drop a partition for a
table. This doesn't remove the data for a table. But if ``PURGE`` is specified,
the partition data will be removed. The metadata is completely lost in all
cases. An error is thrown if the partition for the table doesn't exists. You
can use ``IF EXISTS`` to skip the error.
+
+========================
+REPAIR PARTITION
+========================
+
+Tajo stores a list of partitions for each table in its catalog. If
partitions are manually added to the distributed file system, the metastore is
not aware of these partitions. Running the ``ALTER TABLE REPAIR PARTITION``
statement ensures that the tables are properly populated.
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> REPAIR PARTITION
+
+*Examples*
+
+.. code-block:: sql
+
+ ALTER TABLE student REPAIR PARTITION;
+
+.. note::
+
+ If you recover partitions in the situation that partitions just exists
on catalog and it doesn't exist on file system, Tajo would not make directories
on the file system and would print messages to TajoMaster log as following:
--- End diff --
How about changing this paragraph to as follows?
```
Even though an information of a partition is stored in the catalog, Tajo
does not recover it when its partition directory doesn't exist in the file
system.
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---