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

    https://github.com/apache/flink/pull/4471#discussion_r132230387
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/util/UpdatingPlanChecker.scala
 ---
    @@ -56,17 +59,20 @@ object UpdatingPlanChecker {
       }
     
       /** Identifies unique key fields in the output of a RelNode. */
    -  private class UniqueKeyExtractor extends RelVisitor {
    -
    -    var keys: Option[Array[String]] = None
    +  private class UniqueKeyExtractor {
     
    -    override def visit(node: RelNode, ordinal: Int, parent: RelNode): Unit 
= {
    +    // visit() function will return a tuple, the first element of tuple is 
the key, the second is
    +    // the key's corresponding ancestor. Ancestors are used to identify 
same keys, for example:
    +    // select('pk as pk1, 'pk as pk2), both pk1 and pk2 have the same 
ancestor, i.e., pk.
    +    // A node having keys means: 1.it generates keys by itself 2.all 
ancestors from it's upstream
    +    // nodes have been preserved even though the ancestors have been 
duplicated.
    +    def visit(node: RelNode): Option[List[(String, String)]] = {
           node match {
             case c: DataStreamCalc =>
    -          super.visit(node, ordinal, parent)
    -          // check if input has keys
    -          if (keys.isDefined) {
    -            // track keys forward
    +          val keyAncestors = visit(node.getInput(0))
    --- End diff --
    
    `keyAncestors` -> `inputKeys`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to