[
https://issues.apache.org/jira/browse/FLINK-11001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16718873#comment-16718873
]
ASF GitHub Bot commented on FLINK-11001:
----------------------------------------
hequn8128 opened a new pull request #7289: [FLINK-11001][table] Fix window
rowtime attribute can't be renamed bug in Java
URL: https://github.com/apache/flink/pull/7289
## What is the purpose of the change
This pull request fixes the bug that window rowtime attribute can't be
renamed in Java. It also changes the alias logic for proctime and rowtime
fields in source, so it will **break** backward compatibility.
The reason to change the alias logic in source is that we should make all
alias logic consistent, as described in the
jira(https://issues.apache.org/jira/browse/FLINK-11001).
## Brief change log
- Support time attribute alias in `ExpressionParser`.
- Change time attribute alias logic in source.
- Add tests.
## Verifying this change
This change added tests and can be verified as follows:
- Added tests in `AggregateStringExpressionTest` to test proctime and
rowtime rename.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> 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
>
> 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)