Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/4471#discussion_r132230160
--- 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
--- End diff --
`A node can have keys if it generates the keys by itself or it forwards
keys from its input(s).`?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---