Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2562#discussion_r81945161 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/logical/operators.scala --- @@ -55,28 +56,27 @@ case class Project(projectList: Seq[NamedExpression], child: LogicalNode) extend override def validate(tableEnv: TableEnvironment): LogicalNode = { val resolvedProject = super.validate(tableEnv).asInstanceOf[Project] + val names: mutable.Set[String] = mutable.Set() - def checkUniqueNames(exprs: Seq[Expression]): Unit = { - val names: mutable.Set[String] = mutable.Set() - exprs.foreach { - case n: Alias => - // explicit name - if (names.contains(n.name)) { - throw ValidationException(s"Duplicate field name ${n.name}.") - } else { - names.add(n.name) - } - case r: ResolvedFieldReference => - // simple field forwarding - if (names.contains(r.name)) { - throw ValidationException(s"Duplicate field name ${r.name}.") - } else { - names.add(r.name) - } - case _ => // Do nothing + def checkName(name: String): Unit = { + if (names.contains(name)) { + throw ValidationException(s"Duplicate field name $name.") --- End diff -- use `failValidation()`
--- 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. ---