Github user KurtYoung commented on a diff in the pull request:
https://github.com/apache/flink/pull/3560#discussion_r106669352
--- 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 --
I think using Set here gave us better intuition that we actually want to
count uniq fields, any reason why you want to keep the order? Especially the
order is not defined very well, it will change easily if we modify the code.
---
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.
---