flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flink Jira Bot (Jira)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-5677) Validation layer should check whether field can be used as grouping key
Date Thu, 22 Apr 2021 12:15:02 GMT

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

Flink Jira Bot updated FLINK-5677:
----------------------------------
    Labels: stale-major  (was: )

> 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: Major
>              Labels: stale-major
>
> 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.3.4#803005)

Mime
View raw message