SHOW-PARTITIONS
Name
SHOW PARTITIONS
Description
This statement is used to display partitions
Syntax:
SHOW [TEMPORARY] PARTITIONS FROM [db_name.]table_name [WHERE] [ORDER BY] [LIMIT];
Note:
- Support the filtering of PartitionId, PartitionName, State, Buckets, ReplicationNum, LastConsistencyCheckTime and other columns
- TEMPORARY specifies to list temporary partitions
Example
- Display all non-temporary partitions of the specified table under the specified db
SHOW PARTITIONS FROM example_db.table_name;
-
Display all temporary partitions of the specified table under the specified db
SHOW TEMPORARY PARTITIONS FROM example_db.table_name;
-
Display the specified non-temporary partitions of the specified table under the specified db
SHOW PARTITIONS FROM example_db.table_name WHERE PartitionName = "p1";
-
Display the latest non-temporary partitions of the specified table under the specified db
SHOW PARTITIONS FROM example_db.table_name ORDER BY PartitionId DESC LIMIT 1;
Keywords
SHOW, PARTITIONS