twalthr commented on a change in pull request #6776: [FLINK-9715][table] Support temporal join with event time URL: https://github.com/apache/flink/pull/6776#discussion_r221574949
########## File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/datastream/DataStreamTemporalJoinToCoProcessTranslator.scala ########## @@ -196,30 +217,27 @@ object DataStreamTemporalJoinToCoProcessTranslator { s"Only single column join key is supported. " + s"Found ${joinInfo.rightKeys} in [$textualRepresentation]") } - val rightKey = joinInfo.rightKeys.get(0) + rightKeysStartingOffset + val rightJoinKeyInputReference = joinInfo.rightKeys.get(0) + rightKeysStartingOffset - val primaryKeyVisitor = new PrimaryKeyVisitor(textualRepresentation) - rightPrimaryKey.accept(primaryKeyVisitor) + val rightPrimaryKeyInputReference = extractInputReference( + rightPrimaryKey, + textualRepresentation) - primaryKeyVisitor.inputReference match { - case None => - throw new IllegalStateException( - s"Failed to find primary key reference in [$textualRepresentation]") - case Some(primaryKeyInputReference) if primaryKeyInputReference != rightKey => - throw new ValidationException( - s"Join key [$rightKey] must be the same as " + - s"temporal table's primary key [$primaryKeyInputReference] " + - s"in [$textualRepresentation]") - case _ => - rightPrimaryKey + if (rightPrimaryKeyInputReference != rightJoinKeyInputReference) { + throw new ValidationException( + s"Join key [$rightJoinKeyInputReference] must be the same as " + + s"temporal table's primary key [$rightPrimaryKey] " + + s"in [$textualRepresentation]") } + + rightPrimaryKey } } /** * Extracts input references from primary key expression. */ - private class PrimaryKeyVisitor(textualRepresentation: String) + private class InputReferenceVisitor(textualRepresentation: String) Review comment: Update comment and exception as well. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 With regards, Apache Git Services