[ 
https://issues.apache.org/jira/browse/FLINK-21058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270106#comment-17270106
 ] 

Rui Li commented on FLINK-21058:
--------------------------------

If this feature is mainly intended for generic tables and is supposed to work 
with HiveCatalog, one side note is that HiveCatalog currently doesn't have 
complete support for generic partitioned tables, e.g. you can't add partitions 
for a generic table.

https://github.com/apache/flink/blob/release-1.12.1/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java#L819

> Add SHOW PARTITION syntax support for flink
> -------------------------------------------
>
>                 Key: FLINK-21058
>                 URL: https://issues.apache.org/jira/browse/FLINK-21058
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table SQL / Planner
>    Affects Versions: 1.12.0
>            Reporter: 孙铮
>            Priority: Minor
>             Fix For: 1.13.0
>
>
> Hive dialect already supports show partitions syntax
>  
> {code:java}
> SHOW PARTITIONS [db_name.]table_name [PARTITION(partition_spec)];
> partition_spec:
>   : (partition_column = partition_col_value, partition_column = 
> partition_col_value, ...)
> Example:
> SHOW PARTITIONS databaseFoo.tableBar PARTITION(ds='2010-03-03', 
> hr='12');{code}
>  
> I think Flink SQL should support this syntax.
>  
> Starting with Hive 4.0.0, SHOW PARTITIONS can optionally use the WHERE/ORDER 
> BY/LIMIT clause to filter/order/limit the resulting list. These clauses work 
> in a similar way as  they do in a SELECT statement.
> {code:java}
> SHOW PARTITIONS [db_name.]table_name [PARTITION(partition_spec)] [WHERE 
> where_condition] [ORDER BY col_list] [LIMIT rows];
> Example:
> SHOW PARTITIONS databaseFoo.tableBar LIMIT 10;                                
>                                
> SHOW PARTITIONS databaseFoo.tableBar PARTITION(ds='2010-03-03') LIMIT 10;     
>                                
> SHOW PARTITIONS databaseFoo.tableBar PARTITION(ds='2010-03-03') ORDER BY hr 
> DESC LIMIT 10;                   
> SHOW PARTITIONS databaseFoo.tableBar PARTITION(ds='2010-03-03') WHERE hr >= 
> 10 ORDER BY hr DESC LIMIT 10;    
> SHOW PARTITIONS databaseFoo.tableBar WHERE hr >= 10 AND ds='2010-03-03' ORDER 
> BY hr DESC LIMIT 10;
> {code}
> I think Flink SQL should also support this syntax later
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to