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/21 14:47:20 UTC

[GitHub] [flink] twalthr opened a new pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

twalthr opened a new pull request #14720:
URL: https://github.com/apache/flink/pull/14720


   ## What is the purpose of the change
   
   `CompileUtils` reuses code based on only the class name. This could be error-prone as code that is slightly different would be ignored. The wrong behavior was visible during code generation of structured types. This PR fixes both the cache in `CompileUtils` as well as introduces a unique class name for `StructuredObjectConverter` for avoiding class name clashed.
   
   ## Brief change log
   
   See above.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows: `DataStructureConverterTest`
   
   ## 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? not applicable
   


----------------------------------------------------------------
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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   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 9ea5ec0214721736e3a57cce1438a96686e8a8bf (Thu Jan 21 14:49:26 UTC 2021)
   
   **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



[GitHub] [flink] twalthr commented on pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   @wuchong could you help with a review here?


----------------------------------------------------------------
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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/generated/CompileUtils.java
##########
@@ -62,7 +62,7 @@
         try {
             Cache<ClassLoader, Class> compiledClasses =
                     COMPILED_CACHE.get(
-                            name,
+                            name + code,

Review comment:
       If we want to take code into account, we only need to use code as the key, because code already include the class name. This can avoid creating a new String as the code may be very big. 
   
   Would be better to add a comment above this to explain why we use code instead of name as the cache key. 




----------------------------------------------------------------
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] twalthr commented on a change in pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/generated/CompileUtils.java
##########
@@ -62,7 +62,7 @@
         try {
             Cache<ClassLoader, Class> compiledClasses =
                     COMPILED_CACHE.get(
-                            name,
+                            name + code,

Review comment:
       I think the runtime overhead is neglectable because we are not in the hotpath but pre-flight phase. But sure, code as a key should be sufficient. I will adapt the PR and add a comment.




----------------------------------------------------------------
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] twalthr commented on pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   @wuchong could you help with a review here?


----------------------------------------------------------------
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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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






----------------------------------------------------------------
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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338",
       "triggerID" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ea5ec0214721736e3a57cce1438a96686e8a8bf Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338) 
   
   <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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338",
       "triggerID" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "675ba043ab3833b9767dd480ab6f6bf7fee9b01e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "675ba043ab3833b9767dd480ab6f6bf7fee9b01e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ea5ec0214721736e3a57cce1438a96686e8a8bf Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338) 
   * 675ba043ab3833b9767dd480ab6f6bf7fee9b01e 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] twalthr closed pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   


----------------------------------------------------------------
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] twalthr commented on a change in pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/generated/CompileUtils.java
##########
@@ -62,7 +62,7 @@
         try {
             Cache<ClassLoader, Class> compiledClasses =
                     COMPILED_CACHE.get(
-                            name,
+                            name + code,

Review comment:
       I think the runtime overhead is neglectable because we are not in the hotpath but pre-flight phase. But sure, code as a key should be sufficient. I will adapt the PR and add a comment.




----------------------------------------------------------------
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] twalthr commented on pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   Thanks for your review @wuchong. I addressed you comment. If there are no objections, I will merge it later today.


----------------------------------------------------------------
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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338",
       "triggerID" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "675ba043ab3833b9767dd480ab6f6bf7fee9b01e",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12374",
       "triggerID" : "675ba043ab3833b9767dd480ab6f6bf7fee9b01e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 675ba043ab3833b9767dd480ab6f6bf7fee9b01e Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12374) 
   
   <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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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






----------------------------------------------------------------
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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338",
       "triggerID" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "675ba043ab3833b9767dd480ab6f6bf7fee9b01e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12374",
       "triggerID" : "675ba043ab3833b9767dd480ab6f6bf7fee9b01e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ea5ec0214721736e3a57cce1438a96686e8a8bf Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338) 
   * 675ba043ab3833b9767dd480ab6f6bf7fee9b01e Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12374) 
   
   <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 commented on pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ea5ec0214721736e3a57cce1438a96686e8a8bf 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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338",
       "triggerID" : "9ea5ec0214721736e3a57cce1438a96686e8a8bf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ea5ec0214721736e3a57cce1438a96686e8a8bf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12338) 
   
   <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 #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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


   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 675ba043ab3833b9767dd480ab6f6bf7fee9b01e (Fri May 28 07:12:44 UTC 2021)
   
   **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



[GitHub] [flink] wuchong commented on a change in pull request #14720: [FLINK-21070][table-runtime-blink] Fix invalid reuse of generated code

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



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/generated/CompileUtils.java
##########
@@ -62,7 +62,7 @@
         try {
             Cache<ClassLoader, Class> compiledClasses =
                     COMPILED_CACHE.get(
-                            name,
+                            name + code,

Review comment:
       If we want to take code into account, we only need to use code as the key, because code already include the class name. This can avoid creating a new String as the code may be very big. 
   
   Would be better to add a comment above this to explain why we use code instead of name as the cache key. 




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