caiconghui opened a new issue #2552: Add filter conditions for "show partitions from table" syntax URL: https://github.com/apache/incubator-doris/issues/2552 **Is your feature request related to a problem? Please describe.** once table may have so many partitions, show partitions without filter make too many rows displayed **Describe the solution you'd like** Add filter conditions:PartitionId,PartitionName,State,Buckets,ReplicationNum,LastConsistencyCheckTime syntax: SHOW PARTITIONS FROM tableName [WHERE PartitionName="xxx"] [ORDER BY LastConsistencyCheckTime DESC] [LIMIT [offset,]rows] Features: 1、Support WHERE/ORDER BY/LIMIT 2、Columns:PartitionId,PartitionName,State,Buckets,ReplicationNum,LastConsistencyCheckTime 3、Only “And” between conditions 4、PartitionName and State column only support "=","like" operator 5、PartitionId, Buckets, ReplicationNum, LastConsistencyCheckTime column support “=”,“>=”,"<=",">","<","!=" operators 6、LastConsistencyCheckTime column support Date and DateTime string, eg:"2019-12-22" or "2019-12-22 22:22:00" TestCase: MySQL [test]> show partitions from doris_test_partition order by PartitionId desc limit 1; +-------------+---------------+----------------+--------------------+--------+--------------+-----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+ | PartitionId | PartitionName | VisibleVersion | VisibleVersionHash | State | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime | LastConsistencyCheckTime | DataSize | +-------------+---------------+----------------+--------------------+--------+--------------+-----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+ | 10019 | p20191124 | 1 | 0 | NORMAL | olap_date | [types: [DATE]; keys: [2019-11-24]; ‥types: [DATE]; keys: [2019-11-25]; ) | id | 5 | 1 | HDD | 9999-12-31 23:59:59 | N/A | .000 | +-------------+---------------+----------------+--------------------+--------+--------------+-----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+ 1 row in set (0.01 sec) MySQL [test]> show partitions from doris_test_partition where PartitionName like '%p201910%'; +-------------+---------------+----------------+--------------------+--------+--------------+-----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+ | PartitionId | PartitionName | VisibleVersion | VisibleVersionHash | State | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime | LastConsistencyCheckTime | DataSize | +-------------+---------------+----------------+--------------------+--------+--------------+-----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+ | 10016 | p20191023 | 1 | 0 | NORMAL | olap_date | [types: [DATE]; keys: [1900-01-01]; ‥types: [DATE]; keys: [2019-10-23]; ) | id | 5 | 1 | HDD | 9999-12-31 23:59:59 | N/A | .000 | +-------------+---------------+----------------+--------------------+--------+--------------+-----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+ 1 row in set (0.01 sec) MySQL [test]>
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org