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 2021/01/13 13:20:52 UTC

[GitHub] [flink] YuvalItzchakov opened a new pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

YuvalItzchakov opened a new pull request #14633:
URL: https://github.com/apache/flink/pull/14633


   <!--
   *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 Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - 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 an erroneous NPE created when using a table from a DataStream that did not assign timestamps and watermarks
   
   
   ## Brief change log
   
   - Fix direct access to `ctx.timestamp()`, validate that it has a timestamp before
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts:
   
   (Maybe, not sure)  - The runtime per-record code paths (performance sensitive): (yes / no / don't know)
   
   ## 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 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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-762709238


   @flinkbot run azure


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



[GitHub] [flink] flinkbot commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998) 
   
   <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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-766081220


   @flinkbot run azure


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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-766089520


   @wuchong I'm going to re-open this PR under a fresh branch.


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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-762653431


   Hi @wuchong. Yes I'm working on it ATM, struggling a bit to get Flink to compile from source but I'm confident I'll resolve it soon


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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998) 
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * 65bd73bc66714cfdd687947f0b1c464ed976cd64 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



[GitHub] [flink] wuchong commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563155187



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -512,18 +512,21 @@ object GenerateUtils {
       contextTerm: String): GeneratedExpression = {
     val resultType = new TimestampType(true, TimestampKind.ROWTIME, 3)
     val resultTypeTerm = primitiveTypeTermForType(resultType)
-    val Seq(resultTerm, nullTerm) = ctx.addReusableLocalVariables(
+    val Seq(resultTerm, nullTerm, timestamp) = ctx.addReusableLocalVariables(
       (resultTypeTerm, "result"),
-      ("boolean", "isNull"))
+      ("boolean", "isNull"),
+      ("Long", "tmp")
+    )
 
     val accessCode =
       s"""
-         |$resultTerm = $TIMESTAMP_DATA.fromEpochMillis($contextTerm.timestamp());
-         |if ($resultTerm == null) {
-         |  throw new RuntimeException("Rowtime timestamp is null. Please make sure that a " +
-         |    "proper TimestampAssigner is defined and the stream environment uses the EventTime " +
-         |    "time characteristic.");
+         |$timestamp = $contextTerm.timestamp();
+         |if ($timestamp == null) {

Review comment:
       I simple way for this problem can be `if ($contextTerm.timestamp() == null)`, then you don't need to declare a tmp variable. 




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



[GitHub] [flink] wuchong commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759557801


   Hi @YuvalItzchakov , I think you can add an IT case in `TimeAttributesITCase`, you can create a `DataStream` without `assignTimestampsAndWatermarks` which should reproduce this problem.
   
   Btw, please also fix the checkstyle error:
   
   ```
   2021-01-13T13:49:30.9144714Z [INFO] --- scalastyle-maven-plugin:1.0.0:check (default) @ flink-table-planner-blink_2.11 ---
   2021-01-13T13:49:43.7187879Z error file=/__w/3/s/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala message=File line length exceeds 100 characters line=521
   ```


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



[GitHub] [flink] flinkbot commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759444934


   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 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 (Wed Jan 13 13:23:02 UTC 2021)
   
   **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-20961).** 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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108






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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * b0e28744da86b772436f806aa24a99f5e7581b6b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320) 
   
   <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



[GitHub] [flink] wuchong commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563157652



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -909,6 +908,62 @@ object GenerateUtils {
            |}
          """.stripMargin
       compares += code
+    })
+    compares.mkString
+  }
+
+  /**
+   * Generates code for comparing row keys.
+   * TODO: Remove this after [[MultiFieldRangeBoundComparatorCodeGenerator]]
+   * is refactored using SortSpec.
+   */
+  def generateRowCompare(

Review comment:
       It seems this method is not used. Is it introduced by accident?




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



[GitHub] [flink] YuvalItzchakov edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-766080388


   @wuchong Apparently not all interfaces of `Context` support `element`. I refactored the code to just do a `null` check on the returned timestamp. Can you please re-run CI?


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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * 00801e0afc7a16f4dbe36493b6df148b70af1de2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233) 
   * b0e28744da86b772436f806aa24a99f5e7581b6b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998) 
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd 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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * 00801e0afc7a16f4dbe36493b6df148b70af1de2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233) 
   
   <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



[GitHub] [flink] wuchong commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-762644603


   Hi @YuvalItzchakov  do you have to to update the pull request?


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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * 00801e0afc7a16f4dbe36493b6df148b70af1de2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233) 
   * b0e28744da86b772436f806aa24a99f5e7581b6b 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



[GitHub] [flink] YuvalItzchakov commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563159502



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -909,6 +908,62 @@ object GenerateUtils {
            |}
          """.stripMargin
       compares += code
+    })
+    compares.mkString
+  }
+
+  /**
+   * Generates code for comparing row keys.
+   * TODO: Remove this after [[MultiFieldRangeBoundComparatorCodeGenerator]]
+   * is refactored using SortSpec.
+   */
+  def generateRowCompare(

Review comment:
       @wuchong Did you rebase off master? Diffing master I see this was added.




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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "766081220",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "1f8df030fc2ed7fab4d134ef9bddcde2f7d413da",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1f8df030fc2ed7fab4d134ef9bddcde2f7d413da",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * b0e28744da86b772436f806aa24a99f5e7581b6b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320) 
   * 1f8df030fc2ed7fab4d134ef9bddcde2f7d413da 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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "766081220",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "1f8df030fc2ed7fab4d134ef9bddcde2f7d413da",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1f8df030fc2ed7fab4d134ef9bddcde2f7d413da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0dd72f721d54953ef805c065a486ac73c18b2ff",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d0dd72f721d54953ef805c065a486ac73c18b2ff",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * b0e28744da86b772436f806aa24a99f5e7581b6b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320) 
   * 1f8df030fc2ed7fab4d134ef9bddcde2f7d413da UNKNOWN
   * d0dd72f721d54953ef805c065a486ac73c18b2ff 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



[GitHub] [flink] YuvalItzchakov commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563155265



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -512,18 +512,21 @@ object GenerateUtils {
       contextTerm: String): GeneratedExpression = {
     val resultType = new TimestampType(true, TimestampKind.ROWTIME, 3)
     val resultTypeTerm = primitiveTypeTermForType(resultType)
-    val Seq(resultTerm, nullTerm) = ctx.addReusableLocalVariables(
+    val Seq(resultTerm, nullTerm, timestamp) = ctx.addReusableLocalVariables(
       (resultTypeTerm, "result"),
-      ("boolean", "isNull"))
+      ("boolean", "isNull"),
+      ("Long", "tmp")
+    )
 
     val accessCode =
       s"""
-         |$resultTerm = $TIMESTAMP_DATA.fromEpochMillis($contextTerm.timestamp());
-         |if ($resultTerm == null) {
-         |  throw new RuntimeException("Rowtime timestamp is null. Please make sure that a " +
-         |    "proper TimestampAssigner is defined and the stream environment uses the EventTime " +
-         |    "time characteristic.");
+         |$timestamp = $contextTerm.timestamp();
+         |if ($timestamp == null) {

Review comment:
       @wuchong Right, it's either this or retrieving the timestamp twice. Whichever is preferred.




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



[GitHub] [flink] YuvalItzchakov commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563158546



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -909,6 +908,62 @@ object GenerateUtils {
            |}
          """.stripMargin
       compares += code
+    })
+    compares.mkString
+  }
+
+  /**
+   * Generates code for comparing row keys.
+   * TODO: Remove this after [[MultiFieldRangeBoundComparatorCodeGenerator]]
+   * is refactored using SortSpec.
+   */
+  def generateRowCompare(

Review comment:
       Weird, I did not add that. Will revert.




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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5ba2774d208ac12b1a0d6e67c426cf06211d4e21 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998) 
   
   <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



[GitHub] [flink] YuvalItzchakov closed pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov closed pull request #14633:
URL: https://github.com/apache/flink/pull/14633


   


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



[GitHub] [flink] wuchong commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563155612



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -512,18 +512,21 @@ object GenerateUtils {
       contextTerm: String): GeneratedExpression = {
     val resultType = new TimestampType(true, TimestampKind.ROWTIME, 3)
     val resultTypeTerm = primitiveTypeTermForType(resultType)
-    val Seq(resultTerm, nullTerm) = ctx.addReusableLocalVariables(
+    val Seq(resultTerm, nullTerm, timestamp) = ctx.addReusableLocalVariables(
       (resultTypeTerm, "result"),
-      ("boolean", "isNull"))
+      ("boolean", "isNull"),
+      ("Long", "tmp")
+    )
 
     val accessCode =
       s"""
-         |$resultTerm = $TIMESTAMP_DATA.fromEpochMillis($contextTerm.timestamp());
-         |if ($resultTerm == null) {
-         |  throw new RuntimeException("Rowtime timestamp is null. Please make sure that a " +
-         |    "proper TimestampAssigner is defined and the stream environment uses the EventTime " +
-         |    "time characteristic.");
+         |$timestamp = $contextTerm.timestamp();
+         |if ($timestamp == null) {

Review comment:
       The cost of get timestamp is negligible. Therefore, I prefer the simper way. 




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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * 65bd73bc66714cfdd687947f0b1c464ed976cd64 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224) 
   * 00801e0afc7a16f4dbe36493b6df148b70af1de2 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



[GitHub] [flink] wuchong commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759899025


   Btw, `TimeAttributesITCase` is only located in old planner, we can create one under `org.apache.flink.table.planner.runtime.stream.table` package in blink planner, and copy tests to it. 


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



[GitHub] [flink] YuvalItzchakov edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-766080388


   @wuchong Apparently not all interfaces of `Context` support `hasTimestamp`. I refactored the code to just do a `null` check on the returned timestamp. Can you please re-run CI?


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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320",
       "triggerID" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b0e28744da86b772436f806aa24a99f5e7581b6b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "766081220",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * b0e28744da86b772436f806aa24a99f5e7581b6b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12320) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759444934


   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 6a11762fc0563eb8186c3128a85c18ed26cc32aa (Fri May 28 07:12:57 UTC 2021)
   
   **Warnings:**
    * **12 pom.xml files were touched**: Check for build and licensing issues.
    * 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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759503250


   @wuchong Where would be the proper place to test 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



[GitHub] [flink] YuvalItzchakov commented on a change in pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on a change in pull request #14633:
URL: https://github.com/apache/flink/pull/14633#discussion_r563156638



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -512,18 +512,21 @@ object GenerateUtils {
       contextTerm: String): GeneratedExpression = {
     val resultType = new TimestampType(true, TimestampKind.ROWTIME, 3)
     val resultTypeTerm = primitiveTypeTermForType(resultType)
-    val Seq(resultTerm, nullTerm) = ctx.addReusableLocalVariables(
+    val Seq(resultTerm, nullTerm, timestamp) = ctx.addReusableLocalVariables(
       (resultTypeTerm, "result"),
-      ("boolean", "isNull"))
+      ("boolean", "isNull"),
+      ("Long", "tmp")
+    )
 
     val accessCode =
       s"""
-         |$resultTerm = $TIMESTAMP_DATA.fromEpochMillis($contextTerm.timestamp());
-         |if ($resultTerm == null) {
-         |  throw new RuntimeException("Rowtime timestamp is null. Please make sure that a " +
-         |    "proper TimestampAssigner is defined and the stream environment uses the EventTime " +
-         |    "time characteristic.");
+         |$timestamp = $contextTerm.timestamp();
+         |if ($timestamp == null) {

Review comment:
       Done




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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-762718369


   @wuchong Can I re-run the CI tests?


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



[GitHub] [flink] flinkbot edited a comment on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-759451108


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5ba2774d208ac12b1a0d6e67c426cf06211d4e21",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11998",
       "triggerID" : "762709238",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4740cf1d2d0a16700698f5f2108ee4a310d942dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224",
       "triggerID" : "65bd73bc66714cfdd687947f0b1c464ed976cd64",
       "triggerType" : "PUSH"
     }, {
       "hash" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233",
       "triggerID" : "00801e0afc7a16f4dbe36493b6df148b70af1de2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4740cf1d2d0a16700698f5f2108ee4a310d942dd UNKNOWN
   * 65bd73bc66714cfdd687947f0b1c464ed976cd64 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12224) 
   * 00801e0afc7a16f4dbe36493b6df148b70af1de2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12233) 
   
   <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



[GitHub] [flink] YuvalItzchakov commented on pull request #14633: [FLINK-20961][table-planner-blink] Fix NPE when no assigned timestamp defined

Posted by GitBox <gi...@apache.org>.
YuvalItzchakov commented on pull request #14633:
URL: https://github.com/apache/flink/pull/14633#issuecomment-766080388


   @wuchong Apparently not all interfaces of `Context` support `hasTimestamp`. I refactored the code to just do a `null` check on the returned timestamp.


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