godfreyhe commented on a change in pull request #14699: URL: https://github.com/apache/flink/pull/14699#discussion_r562339871
########## File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecIntervalJoin.java ########## @@ -0,0 +1,357 @@ +/* + * 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.nodes.exec.stream; + +import org.apache.flink.api.common.functions.FlatMapFunction; +import org.apache.flink.api.common.functions.MapFunction; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.dag.Transformation; +import org.apache.flink.api.java.typeutils.ResultTypeQueryable; +import org.apache.flink.streaming.api.operators.StreamFlatMap; +import org.apache.flink.streaming.api.operators.StreamMap; +import org.apache.flink.streaming.api.operators.co.KeyedCoProcessOperator; +import org.apache.flink.streaming.api.transformations.OneInputTransformation; +import org.apache.flink.streaming.api.transformations.TwoInputTransformation; +import org.apache.flink.streaming.api.transformations.UnionTransformation; +import org.apache.flink.table.api.TableException; +import org.apache.flink.table.data.RowData; +import org.apache.flink.table.planner.delegation.PlannerBase; +import org.apache.flink.table.planner.plan.nodes.exec.ExecEdge; +import org.apache.flink.table.planner.plan.nodes.exec.ExecNode; +import org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase; +import org.apache.flink.table.planner.plan.nodes.exec.utils.IntervalJoinSpec; +import org.apache.flink.table.planner.plan.nodes.exec.utils.JoinSpec; +import org.apache.flink.table.planner.plan.utils.JoinUtil; +import org.apache.flink.table.planner.plan.utils.KeySelectorUtil; +import org.apache.flink.table.runtime.generated.GeneratedJoinCondition; +import org.apache.flink.table.runtime.keyselector.RowDataKeySelector; +import org.apache.flink.table.runtime.operators.join.KeyedCoProcessOperatorWithWatermarkDelay; +import org.apache.flink.table.runtime.operators.join.OuterJoinPaddingUtil; +import org.apache.flink.table.runtime.operators.join.interval.IntervalJoinFunction; +import org.apache.flink.table.runtime.operators.join.interval.ProcTimeIntervalJoin; +import org.apache.flink.table.runtime.operators.join.interval.RowTimeIntervalJoin; +import org.apache.flink.table.runtime.typeutils.InternalTypeInfo; +import org.apache.flink.table.types.logical.RowType; +import org.apache.flink.util.Collector; + +import org.apache.flink.shaded.guava18.com.google.common.collect.Lists; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** {@link StreamExecNode} for a time interval stream join. */ +public class StreamExecIntervalJoin extends ExecNodeBase<RowData> + implements StreamExecNode<RowData> { + + private static final Logger LOGGER = LoggerFactory.getLogger(StreamExecIntervalJoin.class); + + private final IntervalJoinSpec intervalJoinSpec; Review comment: nit: This field is useless as class field ? ########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamPhysicalIntervalJoin.scala ########## @@ -0,0 +1,95 @@ +/* + * 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.nodes.physical.stream + +import org.apache.flink.table.api.TableException +import org.apache.flink.table.planner.calcite.FlinkTypeFactory +import org.apache.flink.table.planner.plan.nodes.common.CommonPhysicalJoin +import org.apache.flink.table.planner.plan.nodes.exec.{ExecEdge, ExecNode} +import org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecIntervalJoin +import org.apache.flink.table.planner.plan.nodes.exec.utils.IntervalJoinSpec +import org.apache.flink.table.planner.plan.nodes.exec.utils.IntervalJoinSpec.WindowBounds +import org.apache.flink.table.planner.plan.utils.PythonUtil.containsPythonCall +import org.apache.flink.table.planner.plan.utils.RelExplainUtil.preferExpressionFormat +import org.apache.calcite.plan._ +import org.apache.calcite.rel.core.{Join, JoinRelType} +import org.apache.calcite.rel.{BiRel, RelNode, RelWriter} +import org.apache.calcite.rex.RexNode + +import scala.collection.JavaConversions._ + +/** + * Stream physical RelNode for a time interval stream join. + */ +class StreamPhysicalIntervalJoin( + cluster: RelOptCluster, + traitSet: RelTraitSet, + leftRel: RelNode, + rightRel: RelNode, + joinType: JoinRelType, + val originalCondition: RexNode, + remainingCondition: RexNode, + windowBounds: WindowBounds) Review comment: add some comments to explain `remainingCondition`, because in general, remainingCondition means the non-equal join condition part ---------------------------------------------------------------- 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: us...@infra.apache.org