You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Hequn Cheng (JIRA)" <ji...@apache.org> on 2018/11/24 09:43:00 UTC

[jira] [Created] (FLINK-11001) Window rowtime attribute can't be renamed in Java

Hequn Cheng created FLINK-11001:
-----------------------------------

             Summary: Window rowtime attribute can't be renamed in Java
                 Key: FLINK-11001
                 URL: https://issues.apache.org/jira/browse/FLINK-11001
             Project: Flink
          Issue Type: Bug
         Environment: 

            Reporter: Hequn Cheng
            Assignee: Hequn Cheng


Currently, we can rename window rowtime attribute like this in Scala:
{code:java}
table
      .window(Tumble over 2.millis on 'rowtime as 'w)
      .groupBy('w)
      .select('w.rowtime as 'rowtime, 'int.count as 'int)
{code}
However, an exception will be thrown if we use java(by changing the Expressions to String):
{code:java}
table
      .window(Tumble over 2.millis on 'rowtime as 'w)
      .groupBy('w)
      .select("w.rowtime as rowtime, int.count as int")
{code}
The Exception is:
{code:java}
org.apache.flink.table.api.ExpressionParserException: Could not parse expression at column 11: `,' expected but `a' found
w.rowtime as rowtime, int.count as int
{code}
 

To solve the problem, we can add rename support in {{ExpressionParser}}. However, this may conflict with the design of source which use as before rowtime:
{code:java}
stream.toTable(
      tEnv,
      ExpressionParser.parseExpressionList("(b as b).rowtime, c as c, a as a"): _*)
{code}
Personally, I think we should keep the two consistent, so the final api would be:
{code:java}
// window case
.select("w.rowtime as rowtime, int.count as int")

// source case
stream.toTable(
      tEnv,
      ExpressionParser.parseExpressionList("b.rowtime as b, c as c, a as a"): _*)
{code}
Any suggestions would be greatly appreciated!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)