You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2018/11/26 10:08:00 UTC

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

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

Fabian Hueske commented on FLINK-11001:
---------------------------------------

Hi [~hequn8128],

I agree, Scala and Java Table API should be as close as possible.
So +1 for the proposed syntax.

Best, Fabian

> 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
>
> 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)