cloud-fan commented on code in PR #36325:
URL: https://github.com/apache/spark/pull/36325#discussion_r858277110


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala:
##########
@@ -184,9 +184,16 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] 
with PredicateHelper wit
                   // scalastyle:on
                   val newOutput = scan.readSchema().toAttributes
                   assert(newOutput.length == groupingExpressions.length + 
finalAggregates.length)
+                  val groupByExprToOutputOrdinal = 
mutable.HashMap.empty[Expression, Int]

Review Comment:
   seems we can simply use an `ArrayBuffer`?
   ```
   if (!normalizedGroupByExpr.contains(expr.canonicalized)) {
     normalizedGroupByExpr.append(expr.canonicalized)
   }
   ```
   and in the caller side
   ```
   case expr if normalizedGroupByExpr.contains(expr.canonicalized)
     val ordinal = normalizedGroupByExpr.indexOf(expr.canonicalized)
     ...
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to