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/12/16 11:18:55 UTC
[GitHub] [flink] jrthe42 opened a new pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
jrthe42 opened a new pull request #14404:
URL: https://github.com/apache/flink/pull/14404
## What is the purpose of the change
This PR tries to refactor `StreamExecJoinRule`, `StreamExecIntervalJoinRule` and `StreamExecTemporalJoinRule`, so that we can elimate the duplicate code.
## Brief change log
- Add abstract class `StreamExecJoinRuleBase` as base implementation for stream-stream join rules, and elimate duplicate code in `StreamExecJoinRule`, `StreamExecIntervalJoinRule` and `StreamExecTemporalJoinRule`
## Verifying this change
This change is already covered by existing 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 edited a comment on pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14404:
URL: https://github.com/apache/flink/pull/14404#discussion_r545795642
##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamExecJoinRuleBase.scala
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.rules.physical.stream
+
+import org.apache.flink.table.planner.plan.`trait`.FlinkRelDistribution
+import org.apache.flink.table.planner.plan.nodes.{FlinkConventions, FlinkRelNode}
+import org.apache.flink.table.planner.plan.nodes.logical.{FlinkLogicalJoin, FlinkLogicalRel, FlinkLogicalSnapshot}
+import org.apache.flink.table.planner.plan.utils.IntervalJoinUtil.WindowBounds
+import org.apache.flink.table.planner.plan.utils.{FlinkRelOptUtil, IntervalJoinUtil}
+import org.apache.calcite.plan.{RelOptRule, RelOptRuleCall, RelTraitSet}
+import org.apache.calcite.plan.RelOptRule.{any, operand}
+import org.apache.calcite.rel.RelNode
+import org.apache.calcite.rex.RexNode
+
+import java.util
+
+/**
+ * Base implementation for rules match stream-stream join, including
+ * regular stream join, interval join and temporal join.
+ */
+abstract class StreamExecJoinRuleBase(description: String)
+ extends RelOptRule(
+ operand(classOf[FlinkLogicalJoin],
+ operand(classOf[FlinkLogicalRel], any()),
+ operand(classOf[FlinkLogicalRel], any())),
+ description) {
+
+ protected def extractWindowBounds(join: FlinkLogicalJoin):
+ (Option[WindowBounds], Option[RexNode]) = {
+ val tableConfig = FlinkRelOptUtil.getTableConfigFromContext(join)
+ IntervalJoinUtil.extractWindowBoundsFromPredicate(
+ join.getCondition,
+ join.getLeft.getRowType.getFieldCount,
+ join.getRowType,
+ join.getCluster.getRexBuilder,
+ tableConfig)
+ }
+
+ override def onMatch(call: RelOptRuleCall): Unit = {
+ val join = call.rel[FlinkLogicalJoin](0)
+ val left = call.rel[FlinkLogicalRel](1)
+ val right = call.rel[FlinkLogicalRel](2)
+
+ def toHashTraitByColumns(
+ columns: util.Collection[_ <: Number],
+ inputTraitSet: RelTraitSet): RelTraitSet = {
+ val distribution = if (columns.size() == 0) {
+ FlinkRelDistribution.SINGLETON
+ } else {
+ FlinkRelDistribution.hash(columns)
+ }
+ inputTraitSet
+ .replace(FlinkConventions.STREAM_PHYSICAL)
+ .replace(distribution)
+ }
+
+ val newRight = right match {
+ case snapshot: FlinkLogicalSnapshot =>
+ snapshot.getInput
+ case rel: FlinkLogicalRel => rel
+ }
Review comment:
The only concern from my side is that the base rule class has some special transformation logic for temporal join. This may has some side effect in the long future, e.g. we may support regular join with snapshot in the future. Would be better to let the temporal join rule to handle this transformation.
In order to this, one idea is that we can provide conversion function instead of the converted rel node:
```scala
protected def transform(
join: FlinkLogicalJoin,
leftConversion: RelNode => RelNode,
rightConversion: RelNode => RelNode,
providedTraitSet: RelTraitSet): FlinkRelNode
```
----------------------------------------------------------------
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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068",
"triggerID" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"triggerType" : "PUSH"
}, {
"hash" : "794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* dd0716385b6e0c59ae8d9b33cd56d191bd65342a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068)
* 794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0 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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928)
* dd0716385b6e0c59ae8d9b33cd56d191bd65342a 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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068",
"triggerID" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* dd0716385b6e0c59ae8d9b33cd56d191bd65342a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068)
<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] jrthe42 commented on pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
jrthe42 commented on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-747162076
@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] wuchong merged pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #14404:
URL: https://github.com/apache/flink/pull/14404
----------------------------------------------------------------
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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14404:
URL: https://github.com/apache/flink/pull/14404#discussion_r546488388
##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamExecJoinRuleBase.scala
##########
@@ -70,28 +70,30 @@ abstract class StreamExecJoinRuleBase(description: String)
.replace(distribution)
}
- val newRight = right match {
- case snapshot: FlinkLogicalSnapshot =>
- snapshot.getInput
- case rel: FlinkLogicalRel => rel
+ def convertInput(input: RelNode, columns: util.Collection[_ <: Number]): RelNode = {
+ val requiredTraitSet = toHashTraitByColumns(columns, input.getTraitSet)
+ RelOptRule.convert(input, requiredTraitSet)
}
val joinInfo = join.analyzeCondition
- val (leftRequiredTrait, rightRequiredTrait) = (
- toHashTraitByColumns(joinInfo.leftKeys, left.getTraitSet),
- toHashTraitByColumns(joinInfo.rightKeys, newRight.getTraitSet))
-
- val convertedLeft: RelNode = RelOptRule.convert(left, leftRequiredTrait)
- val convertedRight: RelNode = RelOptRule.convert(newRight, rightRequiredTrait)
val providedTraitSet: RelTraitSet = join.getTraitSet.replace(FlinkConventions.STREAM_PHYSICAL)
- val newJoin = transform(join, convertedLeft, convertedRight, providedTraitSet)
+ val leftConversion = leftInput => {
+ convertInput(leftInput, joinInfo.leftKeys)
+ }
+ val rightConversion = rightInput => {
+ convertInput(rightInput, joinInfo.rightKeys)
+ }
+
+ val newJoin = transform(join, left, leftConversion, right, rightConversion, providedTraitSet)
call.transformTo(newJoin)
}
protected def transform(
join: FlinkLogicalJoin,
- convertedLeft: RelNode,
- convertedRight: RelNode,
+ leftInput: FlinkRelNode,
Review comment:
I think we don't need the `leftInput` parameter, it can be derived from the join node `join.getLeft`.
----------------------------------------------------------------
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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068",
"triggerID" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928)
* dd0716385b6e0c59ae8d9b33cd56d191bd65342a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 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] jrthe42 commented on a change in pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
jrthe42 commented on a change in pull request #14404:
URL: https://github.com/apache/flink/pull/14404#discussion_r546571928
##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamExecJoinRuleBase.scala
##########
@@ -70,28 +70,30 @@ abstract class StreamExecJoinRuleBase(description: String)
.replace(distribution)
}
- val newRight = right match {
- case snapshot: FlinkLogicalSnapshot =>
- snapshot.getInput
- case rel: FlinkLogicalRel => rel
+ def convertInput(input: RelNode, columns: util.Collection[_ <: Number]): RelNode = {
+ val requiredTraitSet = toHashTraitByColumns(columns, input.getTraitSet)
+ RelOptRule.convert(input, requiredTraitSet)
}
val joinInfo = join.analyzeCondition
- val (leftRequiredTrait, rightRequiredTrait) = (
- toHashTraitByColumns(joinInfo.leftKeys, left.getTraitSet),
- toHashTraitByColumns(joinInfo.rightKeys, newRight.getTraitSet))
-
- val convertedLeft: RelNode = RelOptRule.convert(left, leftRequiredTrait)
- val convertedRight: RelNode = RelOptRule.convert(newRight, rightRequiredTrait)
val providedTraitSet: RelTraitSet = join.getTraitSet.replace(FlinkConventions.STREAM_PHYSICAL)
- val newJoin = transform(join, convertedLeft, convertedRight, providedTraitSet)
+ val leftConversion = leftInput => {
+ convertInput(leftInput, joinInfo.leftKeys)
+ }
+ val rightConversion = rightInput => {
+ convertInput(rightInput, joinInfo.rightKeys)
+ }
+
+ val newJoin = transform(join, left, leftConversion, right, rightConversion, providedTraitSet)
call.transformTo(newJoin)
}
protected def transform(
join: FlinkLogicalJoin,
- convertedLeft: RelNode,
- convertedRight: RelNode,
+ leftInput: FlinkRelNode,
Review comment:
`join.getLeft` and `join.getRight` will return `RelSubset`, we can not use that directly
----------------------------------------------------------------
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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068",
"triggerID" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"triggerType" : "PUSH"
}, {
"hash" : "794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11103",
"triggerID" : "794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* dd0716385b6e0c59ae8d9b33cd56d191bd65342a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068)
* 794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11103)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11068",
"triggerID" : "dd0716385b6e0c59ae8d9b33cd56d191bd65342a",
"triggerType" : "PUSH"
}, {
"hash" : "794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11103",
"triggerID" : "794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 794ff7d81e8a74032fe24dc9fbceb7ec54f14fa0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11103)
<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 #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746134508
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 b8f43eb25f0360886d7cf5bf47449d7122347f79 (Wed Dec 16 11:21:54 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-20624).** 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] jrthe42 commented on a change in pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
jrthe42 commented on a change in pull request #14404:
URL: https://github.com/apache/flink/pull/14404#discussion_r546256782
##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamExecJoinRuleBase.scala
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.rules.physical.stream
+
+import org.apache.flink.table.planner.plan.`trait`.FlinkRelDistribution
+import org.apache.flink.table.planner.plan.nodes.{FlinkConventions, FlinkRelNode}
+import org.apache.flink.table.planner.plan.nodes.logical.{FlinkLogicalJoin, FlinkLogicalRel, FlinkLogicalSnapshot}
+import org.apache.flink.table.planner.plan.utils.IntervalJoinUtil.WindowBounds
+import org.apache.flink.table.planner.plan.utils.{FlinkRelOptUtil, IntervalJoinUtil}
+import org.apache.calcite.plan.{RelOptRule, RelOptRuleCall, RelTraitSet}
+import org.apache.calcite.plan.RelOptRule.{any, operand}
+import org.apache.calcite.rel.RelNode
+import org.apache.calcite.rex.RexNode
+
+import java.util
+
+/**
+ * Base implementation for rules match stream-stream join, including
+ * regular stream join, interval join and temporal join.
+ */
+abstract class StreamExecJoinRuleBase(description: String)
+ extends RelOptRule(
+ operand(classOf[FlinkLogicalJoin],
+ operand(classOf[FlinkLogicalRel], any()),
+ operand(classOf[FlinkLogicalRel], any())),
+ description) {
+
+ protected def extractWindowBounds(join: FlinkLogicalJoin):
+ (Option[WindowBounds], Option[RexNode]) = {
+ val tableConfig = FlinkRelOptUtil.getTableConfigFromContext(join)
+ IntervalJoinUtil.extractWindowBoundsFromPredicate(
+ join.getCondition,
+ join.getLeft.getRowType.getFieldCount,
+ join.getRowType,
+ join.getCluster.getRexBuilder,
+ tableConfig)
+ }
+
+ override def onMatch(call: RelOptRuleCall): Unit = {
+ val join = call.rel[FlinkLogicalJoin](0)
+ val left = call.rel[FlinkLogicalRel](1)
+ val right = call.rel[FlinkLogicalRel](2)
+
+ def toHashTraitByColumns(
+ columns: util.Collection[_ <: Number],
+ inputTraitSet: RelTraitSet): RelTraitSet = {
+ val distribution = if (columns.size() == 0) {
+ FlinkRelDistribution.SINGLETON
+ } else {
+ FlinkRelDistribution.hash(columns)
+ }
+ inputTraitSet
+ .replace(FlinkConventions.STREAM_PHYSICAL)
+ .replace(distribution)
+ }
+
+ val newRight = right match {
+ case snapshot: FlinkLogicalSnapshot =>
+ snapshot.getInput
+ case rel: FlinkLogicalRel => rel
+ }
Review comment:
@wuchong Thanks for your review, I have made an update based on the 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] flinkbot edited a comment on pull request #14404: [FLINK-20624][table-planner]Refactor StreamExecJoinRule, StreamExecIntervalJoinRule and StreamExecTemporalJoinRule
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14404:
URL: https://github.com/apache/flink/pull/14404#issuecomment-746157858
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"triggerType" : "PUSH"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
}, {
"hash" : "b8f43eb25f0360886d7cf5bf47449d7122347f79",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928",
"triggerID" : "747162076",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* b8f43eb25f0360886d7cf5bf47449d7122347f79 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10972) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10928)
<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