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

[GitHub] [flink] TsReaper opened a new pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

TsReaper opened a new pull request #13837:
URL: https://github.com/apache/flink/pull/13837


   ## What is the purpose of the change
   
   `JoinDeriveNullFilterRule` will filter out null join keys to prevent data skew for joins. Currently this rule is only applied before join reorder. After join reorder the join keys for some inputs might change and we need to apply this rule again.
   
   This PR applies the rule again after join reorder.
   
   ## Brief change log
   
    - Apply `JoinDeriveNullFilterRule` after join reorder
   
   ## Verifying this change
   
   This change added tests and can be verified by running the added tests.
   
   ## 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 #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "247a8b4a1ac69558d38fa82b8c346dbc407b79c6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "247a8b4a1ac69558d38fa82b8c346dbc407b79c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 247a8b4a1ac69558d38fa82b8c346dbc407b79c6 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 commented on pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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


   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 247a8b4a1ac69558d38fa82b8c346dbc407b79c6 (Thu Oct 29 07:27:38 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-19874).** 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 #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "247a8b4a1ac69558d38fa82b8c346dbc407b79c6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8576",
       "triggerID" : "247a8b4a1ac69558d38fa82b8c346dbc407b79c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 247a8b4a1ac69558d38fa82b8c346dbc407b79c6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8576) 
   
   <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 #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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






----------------------------------------------------------------
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 #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "247a8b4a1ac69558d38fa82b8c346dbc407b79c6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8576",
       "triggerID" : "247a8b4a1ac69558d38fa82b8c346dbc407b79c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 247a8b4a1ac69558d38fa82b8c346dbc407b79c6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8576) 
   
   <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] godfreyhe commented on a change in pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/FlinkBatchRuleSets.scala
##########
@@ -222,7 +222,8 @@ object FlinkBatchRuleSets {
   val JOIN_COND_EQUAL_TRANSFER_RULES: RuleSet = RuleSets.ofList((
     RuleSets.ofList(JoinConditionEqualityTransferRule.INSTANCE).asScala ++
       PREDICATE_SIMPLIFY_EXPRESSION_RULES.asScala ++
-      FILTER_RULES.asScala
+      FILTER_RULES.asScala ++
+      RuleSets.ofList(JoinDeriveNullFilterRule.INSTANCE).asScala

Review comment:
       It's better we do not put `JoinDeriveNullFilterRule`  into `JOIN_COND_EQUAL_TRANSFER_RULES` collection, instead I suggest we can add a program into  `JOIN_REWRITE` stage after `JOIN_COND_EQUAL_TRANSFER_RULES`

##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/common/JoinReorderTestBase.scala
##########
@@ -69,6 +70,27 @@ abstract class JoinReorderTestBase extends TableTestBase {
         "b5" -> new ColumnStats(200L, 0L, 8.0, 8, null, null)
       ))).build())
 
+    util.addTableSource("T6", types, Array("a6", "b6", "c6"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a6" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b6" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c6" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)

Review comment:
       please do not use deprecated constructor

##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/common/JoinReorderTestBase.scala
##########
@@ -69,6 +70,27 @@ abstract class JoinReorderTestBase extends TableTestBase {
         "b5" -> new ColumnStats(200L, 0L, 8.0, 8, null, null)
       ))).build())
 
+    util.addTableSource("T6", types, Array("a6", "b6", "c6"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a6" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b6" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c6" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)
+      ))).build())
+
+    util.addTableSource("T7", types, Array("a7", "b7", "c7"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a7" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b7" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c7" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)
+      ))).build())
+
+    util.addTableSource("T8", types, Array("a8", "b8", "c8"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a8" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b8" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c8" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)
+      ))).build())

Review comment:
       if they are only used in one case, we can move them into the specific test




----------------------------------------------------------------
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] godfreyhe commented on a change in pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/common/JoinReorderTestBase.scala
##########
@@ -69,6 +70,27 @@ abstract class JoinReorderTestBase extends TableTestBase {
         "b5" -> new ColumnStats(200L, 0L, 8.0, 8, null, null)
       ))).build())
 
+    util.addTableSource("T6", types, Array("a6", "b6", "c6"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a6" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b6" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c6" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)
+      ))).build())
+
+    util.addTableSource("T7", types, Array("a7", "b7", "c7"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a7" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b7" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c7" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)
+      ))).build())
+
+    util.addTableSource("T8", types, Array("a8", "b8", "c8"), FlinkStatistic.builder()
+      .tableStats(new TableStats(500000L, Map(
+        "a8" -> new ColumnStats(200000L, 50000L, 4.0, 4, null, null),
+        "b8" -> new ColumnStats(100000L, 0L, 8.0, 8, null, null),
+        "c8" -> new ColumnStats(50000L, 20000L, 8.0, 8, null, null)
+      ))).build())

Review comment:
       if they are only used in one test method, we can move them into the specific method




----------------------------------------------------------------
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] godfreyhe merged pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

Posted by GitBox <gi...@apache.org>.
godfreyhe merged pull request #13837:
URL: https://github.com/apache/flink/pull/13837


   


----------------------------------------------------------------
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] TsReaper commented on pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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


   @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] godfreyhe commented on a change in pull request #13837: [FLINK-19874][table-planner-blink] Apply JoinDeriveNullFilterRule after join reorder

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



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/FlinkBatchRuleSets.scala
##########
@@ -222,10 +222,13 @@ object FlinkBatchRuleSets {
   val JOIN_COND_EQUAL_TRANSFER_RULES: RuleSet = RuleSets.ofList((
     RuleSets.ofList(JoinConditionEqualityTransferRule.INSTANCE).asScala ++
       PREDICATE_SIMPLIFY_EXPRESSION_RULES.asScala ++
-      FILTER_RULES.asScala ++
-      RuleSets.ofList(JoinDeriveNullFilterRule.INSTANCE).asScala
+      FILTER_RULES.asScala
     ).asJava)
 
+  val JOIN_NULL_FILTER_RULES: RuleSet = RuleSets.ofList(

Review comment:
       It's better `JOIN_PREDICATE_REWRITE_RULES` could reuse this rule set




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