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/09/30 04:06:00 UTC
[jira] [Closed] (FLINK-19444) flink 1.11 sql group by tumble Window
aggregate can only be defined over a time attribute column, but
TIMESTAMP(3) encountered
[ https://issues.apache.org/jira/browse/FLINK-19444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jark Wu closed FLINK-19444.
---------------------------
Resolution: Not A Problem
The exception is as expected. See https://ci.apache.org/projects/flink/flink-docs-master/dev/table/streaming/time_attributes.html
> flink 1.11 sql group by tumble Window aggregate can only be defined over a time attribute column, but TIMESTAMP(3) encountered
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: FLINK-19444
> URL: https://issues.apache.org/jira/browse/FLINK-19444
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 1.11.2
> Reporter: panxiaohu
> Priority: Major
>
> Here's the code:
> String createSql = "CREATE TABLE clicks (\n" +
> " `user` STRING,\n" +
> " create_time TIMESTAMP(3),\n" +
> " PRIMARY KEY (`user`) NOT ENFORCED\n" +
> ") WITH (\n" +
> " 'connector' = 'jdbc',\n" +
> " 'url' = 'jdbc:mysql://localhost:3306/learning',\n" +
> " 'username' = 'root',\n" +
> " 'password' = 'john123',\n" +
> " 'table-name' = 'clicks'\n" +
> ")";
> Table table = tableEnv.sqlQuery("select user,TUMBLE_START(create_time, INTERVAL '1' DAY),count(user) from clicks group by TUMBLE(create_time, INTERVAL '1' DAY),user" );
>
> then exception occurs as follows:
> org.apache.flink.table.api.TableException: Window aggregate can only be defined over a time attribute column, but TIMESTAMP(3) encountered.org.apache.flink.table.api.TableException: Window aggregate can only be defined over a time attribute column, but TIMESTAMP(3) encountered.
> at org.apache.flink.table.planner.plan.rules.logical.StreamLogicalWindowAggregateRule.getInAggregateGroupExpression(StreamLogicalWindowAggregateRule.scala:50) at org.apache.flink.table.planner.plan.rules.logical.LogicalWindowAggregateRuleBase.onMatch(LogicalWindowAggregateRuleBase.scala:79) at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:328) at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:562) at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:427) at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:264) at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:127)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)