You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/07 07:25:58 UTC

[GitHub] [flink] libenchao opened a new pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

libenchao opened a new pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784
 
 
   …eBase
   
   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Travis CI to do that following [this guide](https://flink.apache.org/contributing/contribute-code.html#open-a-pull-request).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   Fix time field index error in some cases.
   
   ## Brief change log
   
   Calculate time field index based on new `LogicalProject` directly in `LogicalWindowAggregateRuleBase`.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   WindowAggregateITCase. testDoubleTumbleWindow
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong merged pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#discussion_r365690301
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala
 ##########
 @@ -100,6 +100,35 @@ class WindowAggregateITCase(mode: StateBackendMode)
     assertEquals(expected.sorted, sink.getAppendResults.sorted)
   }
 
+  @Test
+  def testDoubleTumbleWindow(): Unit = {
 
 Review comment:
   Please rename to `testCascadingTumbleWindow` or `testNestedTumbleWindow`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571470100
 
 
   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit d6b24766504bc1f1f1d001e6faa3f85e2f4667e9 (Tue Jan 07 07:29:28 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-15494).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] libenchao commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
libenchao commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-572374507
 
 
   @JingsongLi Could you help to review this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144249050 TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4309 TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   * c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144249050) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4309) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   * c58517317e7de5dda91742eaf5d0e6d23d3d14a0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] libenchao commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
libenchao commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-573944576
 
 
   @wuchong Thanks for your kindly review. I have updated the pr according to the comments.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#discussion_r365759754
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala
 ##########
 @@ -100,6 +100,35 @@ class WindowAggregateITCase(mode: StateBackendMode)
     assertEquals(expected.sorted, sink.getAppendResults.sorted)
   }
 
+  @Test
+  def testDoubleTumbleWindow(): Unit = {
 
 Review comment:
   Could you add a similar nested window agg test for batch? 
   You can place it in `org.apache.flink.table.planner.runtime.batch.sql.agg.WindowAggregateITCase`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/144249050 TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4309 TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   * c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/144249050) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4309) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] JingsongLi commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-572917274
 
 
   CC: @wuchong 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/144249050 TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   Hash:c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4309 TriggerType:PUSH TriggerID:c58517317e7de5dda91742eaf5d0e6d23d3d14a0
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   * c58517317e7de5dda91742eaf5d0e6d23d3d14a0 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/144249050) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4309) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#issuecomment-571473399
 
 
   <!--
   Meta data
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   Hash:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/143353476 TriggerType:PUSH TriggerID:d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec
   -->
   ## CI report:
   
   * d0e5cb3e0d2cc118c98cd91e0470c5123219d1ec Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/143353476) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4149) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#discussion_r365764205
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/BatchLogicalWindowAggregateRule.scala
 ##########
 @@ -62,27 +61,14 @@ class BatchLogicalWindowAggregateRule
       throw new ValidationException("Window can not be defined over "
         + "a proctime attribute column for batch mode")
     }
-    operand match {
-      case c: RexCall if c.getKind == SqlKind.CAST =>
-        getTimeFieldReference(c.getOperands.get(0), windowExprIdx, rowType)
-      // match TUMBLE_ROWTIME and TUMBLE_PROCTIME
-      case c: RexCall if c.getOperands.size() == 1 &&
-        FlinkTypeFactory.isTimeIndicatorType(c.getType) =>
-        new FieldReferenceExpression(
-          rowType.getFieldList.get(windowExprIdx).getName,
-          fromLogicalTypeToDataType(toLogicalType(c.getType)),
-          0, // only one input, should always be 0
-          windowExprIdx)
-      case ref: RexInputRef =>
-        // resolve field name of window attribute
-        val fieldName = rowType.getFieldList.get(ref.getIndex).getName
-        val fieldType = rowType.getFieldList.get(ref.getIndex).getType
-        new FieldReferenceExpression(
-          fieldName,
-          fromLogicalTypeToDataType(toLogicalType(fieldType)),
-          0, // only one input, should always be 0
-          windowExprIdx)
-    }
+
+    val fieldName = rowType.getFieldList.get(windowExprIdx).getName
+    val fieldType = rowType.getFieldList.get(windowExprIdx).getType
+    new FieldReferenceExpression(
+      fieldName,
+      fromLogicalTypeToDataType(toLogicalType(fieldType)),
+      0,
+      windowExprIdx)
 
 Review comment:
   The fix looks good to me. However, could you add some comments or change the parameter `windowExprIdx` to `timeAttributeIndex` ? As we know, `windowExprIdx` is `timeAttributeIndex` and so the rowtime field reference is accessed by `windowExprIdx`.
   
   The same to `StreamLogicalWindowAggregateRule`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #10784: [FLINK-15494] Fix time field index wrong in LogicalWindowAggregateRul…
URL: https://github.com/apache/flink/pull/10784#discussion_r365765439
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/LogicalWindowAggregateRuleBase.scala
 ##########
 @@ -88,6 +85,9 @@ abstract class LogicalWindowAggregateRuleBase(description: String)
       .project(project.getChildExps.updated(windowExprIdx, inAggGroupExpression))
       .build()
 
+    // translate window against newProject.
+    val window = translateWindow(windowExpr, windowExprIdx, newProject.getRowType)
 
 Review comment:
   Because `translateWindow` is postponed after `getInAggregateGroupExpression`, so if the time field is not a time attribute, the exception will be thrown from `getInAggregateGroupExpression`. But the exception there is not clear enought. Could you improve the exception in `getInAggregateGroupExpression`? For example: 
   
   ```scala
   s"Window aggregate can only be defined over a time attribute column, but ${timeAttribute.getType} encountered."
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services