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

Fabian Hueske closed FLINK-11001.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.8.0

Fixed for 1.8.0 with ff9b7f1b60a4aeb1d925b236b9818002aad830de

> 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