You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by fhueske <gi...@git.apache.org> on 2017/10/04 19:35:36 UTC

[GitHub] flink pull request #4625: [FLINK-6233] [table] Support time-bounded stream i...

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

    https://github.com/apache/flink/pull/4625#discussion_r142689196
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/datastream/DataStreamWindowJoin.scala ---
    @@ -184,4 +229,50 @@ class DataStreamWindowJoin(
             .returns(returnTypeInfo)
         }
       }
    +
    +  def createRowTimeInnerJoin(
    +      leftDataStream: DataStream[CRow],
    +      rightDataStream: DataStream[CRow],
    +      returnTypeInfo: TypeInformation[CRow],
    +      joinFunctionName: String,
    +      joinFunctionCode: String,
    +      leftKeys: Array[Int],
    +      rightKeys: Array[Int]): DataStream[CRow] = {
    +
    +    val rowTimeInnerJoinFunc = new RowTimeBoundedStreamInnerJoin(
    +      leftLowerBound,
    +      leftUpperBound,
    +      allowedLateness = 0L,
    +      leftSchema.typeInfo,
    +      rightSchema.typeInfo,
    +      joinFunctionName,
    +      joinFunctionCode,
    +      leftTimeIdx,
    +      rightTimeIdx)
    +
    +    if (!leftKeys.isEmpty) {
    +      leftDataStream
    +        .connect(rightDataStream)
    +        .keyBy(leftKeys, rightKeys)
    +        .transform(
    +          "InnerRowtimeWindowJoin",
    +          returnTypeInfo,
    +          new KeyedCoProcessOperatorWithWatermarkDelay[CRow, CRow, CRow, CRow](
    +            rowTimeInnerJoinFunc,
    +            rowTimeInnerJoinFunc.getMaxOutputDelay)
    +        )
    +    } else {
    +      leftDataStream.connect(rightDataStream)
    +        .keyBy(new NullByteKeySelector[CRow](), new NullByteKeySelector[CRow])
    +        .transform(
    +          "InnerRowtimeWindowJoin",
    +          returnTypeInfo,
    +          new KeyedCoProcessOperatorWithWatermarkDelay[CRow, CRow, CRow, CRow](
    --- End diff --
    
    `KEY` type is `Byte` instead of `CRow`


---