Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3269#discussion_r103918266
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/util/RexProgramProjectExtractor.scala
---
@@ -84,6 +108,49 @@ object RexProgramProjectExtractor {
}
/**
+ * A RexVisitor to extract used nested input fields
+ */
+class RefFieldAccessorVisitor(
+ names: List[String],
+ usedFields: Array[Int]) extends RexVisitorImpl[Unit](true) {
+
+ private val projectedFields = new util.ArrayList[Array[String]]
+
+ names.foreach { n =>
+ projectedFields.add(Array.empty)
+ }
+
+ private val order: Map[Int, Int] =
names.indices.zip(usedFields).map(_.swap).toMap
--- End diff --
`names` and `usedFields` might not have the same length.
The result of `zip` has the length of the smaller of both lists which is
not intended here, right?
---
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.
---