[ 
https://issues.apache.org/jira/browse/FLINK-11001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16734222#comment-16734222
 ] 

Timo Walther commented on FLINK-11001:
--------------------------------------

Updated exception message in master: 038dc0008f7b27c787e3ccba2204f3a2851dff7d

> 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
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.8.0
>
>
> 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)

Reply via email to