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

Flink Jira Bot updated FLINK-5677:
----------------------------------
      Labels: auto-deprioritized-major auto-deprioritized-minor  (was: 
auto-deprioritized-major stale-minor)
    Priority: Not a Priority  (was: Minor)

This issue was labeled "stale-minor" 7 days ago and has not received any 
updates so it is being deprioritized. If this ticket is actually Minor, please 
raise the priority and ask a committer to assign you the issue or revive the 
public discussion.


> Validation layer should check whether field can be used as grouping key
> -----------------------------------------------------------------------
>
>                 Key: FLINK-5677
>                 URL: https://issues.apache.org/jira/browse/FLINK-5677
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>            Reporter: Timo Walther
>            Priority: Not a Priority
>              Labels: auto-deprioritized-major, auto-deprioritized-minor
>
> When grouping on a GenericType (e.g. {{Object}}). The validation layer does 
> no checking of types. The {{groupBy/keyBy}} of DataSet/DataStream API throws 
> the exception. The validation layer should check this before.
> {code}
> public static class OuterPojo {
>       public Object object = new Object();
> }
> tEnv.sql("SELECT testing.object FROM testing GROUP BY testing.object")
> {code}
> leads to 
> {code}
> Exception in thread "main" 
> org.apache.flink.api.common.InvalidProgramException: This type 
> (GenericType<java.lang.Object>) cannot be used as key.
>       at 
> org.apache.flink.api.common.operators.Keys$ExpressionKeys.<init>(Keys.java:270)
>       at 
> org.apache.flink.api.common.operators.Keys$ExpressionKeys.<init>(Keys.java:223)
>       at org.apache.flink.api.java.DataSet.groupBy(DataSet.java:692)
>       at 
> org.apache.flink.table.plan.nodes.dataset.DataSetAggregate.translateToPlan(DataSetAggregate.scala:134)
>       at 
> org.apache.flink.table.api.BatchTableEnvironment.translate(BatchTableEnvironment.scala:305)
>       at 
> org.apache.flink.table.api.BatchTableEnvironment.translate(BatchTableEnvironment.scala:289)
>       at 
> org.apache.flink.table.api.java.BatchTableEnvironment.toDataSet(BatchTableEnvironment.scala:146)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to