Github user hequn8128 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5327#discussion_r184994194
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/NonWindowOuterJoin.scala
 ---
    @@ -0,0 +1,303 @@
    +/*
    + * 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.runtime.join
    +
    +import org.apache.flink.api.common.state._
    +import org.apache.flink.api.common.typeinfo.TypeInformation
    +import org.apache.flink.api.java.tuple.{Tuple2 => JTuple2}
    +import org.apache.flink.configuration.Configuration
    +import org.apache.flink.streaming.api.functions.co.CoProcessFunction
    +import org.apache.flink.table.api.{StreamQueryConfig, Types}
    +import org.apache.flink.table.runtime.types.CRow
    +import org.apache.flink.types.Row
    +import org.apache.flink.util.Collector
    +
    +/**
    +  * Connect data for left stream and right stream. Base class for stream 
non-window outer Join.
    +  *
    +  * @param leftType        the input type of left stream
    +  * @param rightType       the input type of right stream
    +  * @param resultType      the output type of join
    +  * @param genJoinFuncName the function code of other non-equi condition
    +  * @param genJoinFuncCode the function name of other non-equi condition
    +  * @param isLeftJoin      the type of join, whether it is the type of 
left join
    +  * @param queryConfig     the configuration for the query to generate
    +  */
    +abstract class NonWindowOuterJoin(
    +    leftType: TypeInformation[Row],
    +    rightType: TypeInformation[Row],
    +    resultType: TypeInformation[CRow],
    +    genJoinFuncName: String,
    +    genJoinFuncCode: String,
    +    isLeftJoin: Boolean,
    +    queryConfig: StreamQueryConfig)
    +  extends NonWindowJoin(
    +    leftType,
    +    rightType,
    +    resultType,
    +    genJoinFuncName,
    +    genJoinFuncCode,
    +    queryConfig) {
    +
    +  // result row, all fields from right will be null. Used for output when 
there is no matched rows.
    +  protected var leftResultRow: Row = _
    +  // result row, all fields from left will be null. Used for output when 
there is no matched rows.
    +  protected var rightResultRow: Row = _
    +  // how many matched rows from the right table for each left row. Index 0 
is used for left
    +  // stream, index 1 is used for right stream.
    +  protected var joinCntState: Array[MapState[Row, Long]] = _
    --- End diff --
    
    OK. I create a base class for outer Join with non-equal 
predicates(`NonWindowOuterJoinWithNonEquiPredicates`).


---

Reply via email to