Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3560#discussion_r107033984
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/ProjectionTranslator.scala
---
@@ -227,18 +227,23 @@ object ProjectionTranslator {
* @param exprs a list of expressions to extract
* @return a list of field references extracted from the given
expressions
*/
- def extractFieldReferences(exprs: Seq[Expression]): Seq[NamedExpression]
= {
- exprs.foldLeft(Set[NamedExpression]()) {
+ def extractFieldReferences(exprs: Seq[Expression]):
List[NamedExpression] = {
+ exprs.foldLeft(List[NamedExpression]()) {
(fieldReferences, expr) => identifyFieldReferences(expr,
fieldReferences)
- }.toSeq
+ }
}
private def identifyFieldReferences(
expr: Expression,
- fieldReferences: Set[NamedExpression]): Set[NamedExpression] = expr
match {
+ fieldReferences: List[NamedExpression]): List[NamedExpression] =
expr match {
--- End diff --
We can also use a `LinkedHashSet` which preserves the order in which
elements are inserted.
---
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.
---