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/02/25 13:36:00 UTC

[GitHub] [flink] lirui-apache opened a new pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

lirui-apache opened a new pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215
 
 
   …with custom module
   
   <!--
   *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
   
   To fix the issue of `AggsHandlerCodeGenerator` working with a custom module.
   
   Code generated by `AggsHandlerCodeGenerator` can fail to compile if certain functions get overridden by custom module:
   ```
   Caused by: org.codehaus.commons.compiler.CompileException: Line 20, Column 215: A method named "getRuntimeContext" is not declared in any enclosing class nor any supertype, nor through a static import
   ```
   
   
   ## Brief change log
   
     - Make sure the generated `AggsHandleFunction` can get `RuntimeContext` properly.
     - Add test case
   
   
   ## Verifying this change
   
   New test case
   
   ## 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, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? NA
   

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a397a816cf507be5810bc6ea2f94a64583fe2ed6 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150624985) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614) 
   
   <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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ea9722ea905907bdbb959633591186a935c168f4 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150481998) 
   
   <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] lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384392713
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/CalcITCase.scala
 ##########
 @@ -1244,4 +1247,40 @@ class CalcITCase extends BatchTestBase {
       Seq(row(1), row(111), row(15), row(34), row(5), row(65), row(null))
     )
   }
+
+  @Test
+  def testRankWithCustomModule(): Unit = {
+    try {
+      tEnv.unloadModule("core")
+      tEnv.loadModule("test-module", new TestModule)
+      tEnv.loadModule("core", CoreModule.INSTANCE)
+      registerCollection("emp",
+        Seq(row("1", "A", 1), row("1", "B", 2), row("2", "C", 3)),
+        new RowTypeInfo(STRING_TYPE_INFO, STRING_TYPE_INFO, INT_TYPE_INFO),
+        "dep,name,salary")
+      checkResult(
+        "select dep,name,rank() over (partition by dep order by salary desc) as rnk from emp",
+        Seq(row("1", "A", 2), row("1", "B", 1), row("2", "C", 1)))
+    } finally {
+      val modules = tEnv.listModules()
 
 Review comment:
   We indeed don't have to do this. Thanks for pointing out.

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
libenchao commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-591443866
 
 
   @lirui-apache Thanks for addressing my comments. LGTM now, +1 for merging.

----------------------------------------------------------------
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] lirui-apache commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590871651
 
 
   @JingsongLi Please have a look. Thanks.

----------------------------------------------------------------
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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
libenchao commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384429839
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/OverWindowITCase.scala
 ##########
 @@ -2576,3 +2594,19 @@ class CountAggFunction extends AggregateFunction[JLong, CountAccumulator] {
 
   override def getResultType: TypeInformation[JLong] = Types.LONG
 }
+
+private class TestModule extends Module {
+
+  private val funcName = "isnull"
 
 Review comment:
   `isnull` -> `isNull` ?

----------------------------------------------------------------
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] lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384341569
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/agg/AggsHandlerCodeGenerator.scala
 ##########
 @@ -333,6 +333,10 @@ class AggsHandlerCodeGenerator(
 
     val functionName = newName(name)
 
+    // make sure we can get the RuntimeContext properly
+    val openCode = ctx.reuseOpenCode().replaceAll("\\(getRuntimeContext\\(\\)\\)",
 
 Review comment:
   I thought it's simpler this way, since we only need get the RuntimeContext in the open method. I'll add a `getRuntimeContext` method if you think that's better.

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150662198",
       "triggerID" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5639",
       "triggerID" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4c27210d2ada62de2ab7a1aed1f00469edb96caf Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150662198) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5639) 
   
   <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 merged pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
JingsongLi merged pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215
 
 
   

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150662198",
       "triggerID" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a397a816cf507be5810bc6ea2f94a64583fe2ed6 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150624985) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614) 
   * 4c27210d2ada62de2ab7a1aed1f00469edb96caf Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150662198) 
   
   <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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r383887093
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/CalcITCase.scala
 ##########
 @@ -1244,4 +1247,40 @@ class CalcITCase extends BatchTestBase {
       Seq(row(1), row(111), row(15), row(34), row(5), row(65), row(null))
     )
   }
+
+  @Test
+  def testRankWithCustomModule(): Unit = {
+    try {
+      tEnv.unloadModule("core")
+      tEnv.loadModule("test-module", new TestModule)
+      tEnv.loadModule("core", CoreModule.INSTANCE)
+      registerCollection("emp",
+        Seq(row("1", "A", 1), row("1", "B", 2), row("2", "C", 3)),
+        new RowTypeInfo(STRING_TYPE_INFO, STRING_TYPE_INFO, INT_TYPE_INFO),
+        "dep,name,salary")
+      checkResult(
 
 Review comment:
   Move this test to `OverWindowITCase`.

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590871475
 
 
   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 4c27210d2ada62de2ab7a1aed1f00469edb96caf (Fri Feb 28 21:48:56 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <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] lirui-apache commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-591439627
 
 
   @libenchao @JingsongLi Thanks for your review. PR updated.

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ea9722ea905907bdbb959633591186a935c168f4 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150481998) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579) 
   * a397a816cf507be5810bc6ea2f94a64583fe2ed6 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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ea9722ea905907bdbb959633591186a935c168f4 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] lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384345272
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/CalcITCase.scala
 ##########
 @@ -1244,4 +1247,40 @@ class CalcITCase extends BatchTestBase {
       Seq(row(1), row(111), row(15), row(34), row(5), row(65), row(null))
     )
   }
+
+  @Test
+  def testRankWithCustomModule(): Unit = {
+    try {
+      tEnv.unloadModule("core")
+      tEnv.loadModule("test-module", new TestModule)
+      tEnv.loadModule("core", CoreModule.INSTANCE)
+      registerCollection("emp",
+        Seq(row("1", "A", 1), row("1", "B", 2), row("2", "C", 3)),
+        new RowTypeInfo(STRING_TYPE_INFO, STRING_TYPE_INFO, INT_TYPE_INFO),
+        "dep,name,salary")
+      checkResult(
+        "select dep,name,rank() over (partition by dep order by salary desc) as rnk from emp",
+        Seq(row("1", "A", 2), row("1", "B", 1), row("2", "C", 1)))
+    } finally {
+      val modules = tEnv.listModules()
 
 Review comment:
   I think `BatchTestBase::tEnv` is only initialized once and shared among test cases. I'll double check.

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ea9722ea905907bdbb959633591186a935c168f4 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150481998) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579) 
   * a397a816cf507be5810bc6ea2f94a64583fe2ed6 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150624985) 
   
   <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] lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384499313
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/OverWindowITCase.scala
 ##########
 @@ -2576,3 +2594,19 @@ class CountAggFunction extends AggregateFunction[JLong, CountAccumulator] {
 
   override def getResultType: TypeInformation[JLong] = Types.LONG
 }
+
+private class TestModule extends Module {
+
+  private val funcName = "isnull"
 
 Review comment:
   I don't think that matters, because I'm using `equalsIgnoreCase` down bellow.

----------------------------------------------------------------
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] lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384497843
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/utils/UserDefinedFunctionTestUtils.scala
 ##########
 @@ -377,6 +377,13 @@ object UserDefinedFunctionTestUtils {
     override def getResultType(signature: Array[Class[_]]): TypeInformation[_] = Types.JAVA_BIG_DEC
   }
 
+  @SerialVersionUID(1L)
+  object MyIsNull extends ScalarFunction {
 
 Review comment:
   Hmm, `IsNullUDF ` sounds better to me

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a397a816cf507be5810bc6ea2f94a64583fe2ed6 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/150624985) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614) 
   * 4c27210d2ada62de2ab7a1aed1f00469edb96caf 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 edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150662198",
       "triggerID" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5639",
       "triggerID" : "4c27210d2ada62de2ab7a1aed1f00469edb96caf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4c27210d2ada62de2ab7a1aed1f00469edb96caf Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150662198) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5639) 
   
   <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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ea9722ea905907bdbb959633591186a935c168f4 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150481998) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579) 
   
   <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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384350350
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/agg/AggsHandlerCodeGenerator.scala
 ##########
 @@ -333,6 +333,10 @@ class AggsHandlerCodeGenerator(
 
     val functionName = newName(name)
 
+    // make sure we can get the RuntimeContext properly
+    val openCode = ctx.reuseOpenCode().replaceAll("\\(getRuntimeContext\\(\\)\\)",
 
 Review comment:
   I think we should avoid some codes like replace string in code generation.
   It may brings some potential bugs in future.

----------------------------------------------------------------
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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r383887681
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/CalcITCase.scala
 ##########
 @@ -1244,4 +1247,40 @@ class CalcITCase extends BatchTestBase {
       Seq(row(1), row(111), row(15), row(34), row(5), row(65), row(null))
     )
   }
+
+  @Test
+  def testRankWithCustomModule(): Unit = {
+    try {
+      tEnv.unloadModule("core")
+      tEnv.loadModule("test-module", new TestModule)
+      tEnv.loadModule("core", CoreModule.INSTANCE)
+      registerCollection("emp",
+        Seq(row("1", "A", 1), row("1", "B", 2), row("2", "C", 3)),
+        new RowTypeInfo(STRING_TYPE_INFO, STRING_TYPE_INFO, INT_TYPE_INFO),
+        "dep,name,salary")
+      checkResult(
+        "select dep,name,rank() over (partition by dep order by salary desc) as rnk from emp",
+        Seq(row("1", "A", 2), row("1", "B", 1), row("2", "C", 1)))
+    } finally {
+      val modules = tEnv.listModules()
 
 Review comment:
   Do we need do this? Every test should be a new context in JUnit?

----------------------------------------------------------------
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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
libenchao commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384429307
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/utils/UserDefinedFunctionTestUtils.scala
 ##########
 @@ -377,6 +377,13 @@ object UserDefinedFunctionTestUtils {
     override def getResultType(signature: Array[Class[_]]): TypeInformation[_] = Types.JAVA_BIG_DEC
   }
 
+  @SerialVersionUID(1L)
+  object MyIsNull extends ScalarFunction {
 
 Review comment:
   maybe we could improve this name: `MyIsNull` ?  
   like `IsNullFunction` or `IsNullUDF` or `IsNullScalarFunction` ?

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590871475
 
 
   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 ea9722ea905907bdbb959633591186a935c168f4 (Tue Feb 25 13:39: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-16275).** 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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
libenchao commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384431171
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/OverWindowITCase.scala
 ##########
 @@ -23,16 +23,20 @@ import org.apache.flink.api.java.tuple.{Tuple1 => JTuple1}
 import org.apache.flink.api.java.typeutils.{RowTypeInfo, TupleTypeInfo}
 import org.apache.flink.api.scala._
 import org.apache.flink.table.api.Types
-import org.apache.flink.table.functions.AggregateFunction
+import org.apache.flink.table.functions.{AggregateFunction, FunctionDefinition, ScalarFunctionDefinition}
+import org.apache.flink.table.module.{CoreModule, Module}
 import org.apache.flink.table.planner.runtime.utils.BatchTestBase
 import org.apache.flink.table.planner.runtime.utils.BatchTestBase.row
 import org.apache.flink.table.planner.runtime.utils.TestData._
+import org.apache.flink.table.planner.runtime.utils.UserDefinedFunctionTestUtils.MyIsNull
 import org.apache.flink.table.planner.utils.DateTimeTestUtil._
 import org.apache.flink.types.Row
 
 import org.junit.{Before, Test}
 
 import java.lang.{Iterable => JIterable, Long => JLong}
+import java.util
+import java.util.{Collections, Optional}
 
 Review comment:
   `java.util` already contains `java.util.{Collections, Optional}` ?

----------------------------------------------------------------
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 #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-590878229
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150481998",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea9722ea905907bdbb959633591186a935c168f4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5579",
       "triggerID" : "ea9722ea905907bdbb959633591186a935c168f4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/150624985",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614",
       "triggerID" : "a397a816cf507be5810bc6ea2f94a64583fe2ed6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a397a816cf507be5810bc6ea2f94a64583fe2ed6 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/150624985) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5614) 
   
   <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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r383886651
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/agg/AggsHandlerCodeGenerator.scala
 ##########
 @@ -333,6 +333,10 @@ class AggsHandlerCodeGenerator(
 
     val functionName = newName(name)
 
+    // make sure we can get the RuntimeContext properly
+    val openCode = ctx.reuseOpenCode().replaceAll("\\(getRuntimeContext\\(\\)\\)",
 
 Review comment:
   What not introduce a method `getRuntimeContext` in this agg handle function?

----------------------------------------------------------------
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 a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
libenchao commented on a change in pull request #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#discussion_r384430453
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/OverWindowITCase.scala
 ##########
 @@ -2576,3 +2594,19 @@ class CountAggFunction extends AggregateFunction[JLong, CountAccumulator] {
 
   override def getResultType: TypeInformation[JLong] = Types.LONG
 }
+
+private class TestModule extends Module {
+
+  private val funcName = "isnull"
+
+  override def listFunctions(): util.Set[String] =
+    new util.HashSet(Collections.singletonList(funcName))
 
 Review comment:
   `Collections.singleton(funcName)` ?

----------------------------------------------------------------
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] lirui-apache commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on issue #11215: [FLINK-16275][table-planner-blink] AggsHandlerCodeGenerator can fail …
URL: https://github.com/apache/flink/pull/11215#issuecomment-591345777
 
 
   @JingsongLi PR updated to address your 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