[
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 stale-minor (was:
auto-deprioritized-major)
I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help
the community manage its development. I see this issues has been marked as
Minor but is unassigned and neither itself nor its Sub-Tasks have been updated
for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is
still Minor, please either assign yourself or give an update. Afterwards,
please remove the label or in 7 days the issue will be deprioritized.
> 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: Minor
> Labels: auto-deprioritized-major, stale-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)