You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/12/02 15:53:00 UTC

[jira] [Closed] (FLINK-20447) Querying grouy by PK does not work

     [ https://issues.apache.org/jira/browse/FLINK-20447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu closed FLINK-20447.
---------------------------
    Resolution: Not A Problem

> Querying grouy by PK does not work
> ----------------------------------
>
>                 Key: FLINK-20447
>                 URL: https://issues.apache.org/jira/browse/FLINK-20447
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>    Affects Versions: 1.11.2
>            Reporter: Zhenwei Feng
>            Priority: Major
>
> Since PRIMARY KEY is unique, it should be feasible to screen columns by PK.
> The problem could be reproduced by creating a simple table:
> {code:java}
> CREATE TABLE test_table(    
>   Code STRING,    
>   Name  STRING,    
>   ...,    
>   PRIMARY KEY (Code) NOT ENFORCED
> )WITH (...)
> {code}
> then parsing a SQL statement `SELECT *FROM test_table GROUP BY Code`. An exception as below will be thrown:
>  
> {code:java}
>  org.apache.calcite.sql.validate.SqlValidatorException: Expression 'test_table.Name' is not being grouped
> {code}
>  
>  
>  
>  



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