SHOW PARTITIONS

Description

Displays partition information.

Syntax

SHOW [TEMPORARY] PARTITIONS FROM [db_name.]table_name [WHERE] [ORDER BY] [LIMIT]

NOTE

This syntax only supports CelerData tables ("ENGINE" = "OLAP"). For Elasticsearch and Hive tables, use SHOW PROC '/dbs/db_id/table_id/partitions'. This operation requires the SELECT privilege on the specified table.

Examples

  1. Display all partition information of the specified table under the specified db

    -- Common partition
    SHOW PARTITIONS FROM example_db.table_name;
    -- Temporary partition
    SHOW TEMPORARY PARTITIONS FROM example_db.table_name;
  2. Display the information of the specified partition of the specified table under the specified db

    -- Common partition
    SHOW PARTITIONS FROM example_db.table_name WHERE PartitionName = "p1";
    -- Temporary partition
    SHOW TEMPORARY PARTITIONS FROM example_db.table_name WHERE PartitionName = "p1";
  3. Display the latest partition information of the specified table under the specified db

    -- Common partition
    SHOW PARTITIONS FROM example_db.table_name ORDER BY PartitionId DESC LIMIT 1;
    -- Temporary partition
    SHOW TEMPORARY PARTITIONS FROM example_db.table_name ORDER BY PartitionId DESC LIMIT 1;