SHOW PARTITIONS statement
Learn about using the WHERE clause to filter the output of the SHOW PARTITIONS statement based on partition column values.
The SHOW PARTITIONS statement displays information such as the number of rows, number of files, and size for table partitions. You can use an optional WHERE clause to filter this output. This is useful for tables with a large number of partitions.
The WHERE clause supports predicates on partition columns.
Example
The following example shows how to filter partitions by using specific year and month values:
SHOW PARTITIONS part_tbl WHERE year = 2025 AND month < 6;
Usage Notes
You can only use partition columns in the WHERE clause.
The statement does not support non-partition columns, subqueries, or analytic expressions.
