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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/package.scala:
##########
@@ -122,7 +191,8 @@ package object expressions  {
      * Returns the index of first attribute with a matching expression id, or 
-1 if no match exists.
      */
     def indexOf(exprId: ExprId): Int = {
-      Option(exprIdToOrdinal.get(exprId)).getOrElse(-1)
+      val id = exprId.id
+      exprIdToOrdinal(id)

Review Comment:
   do we have boxing issue with invoking this lambda function? One idea is to 
have both the array and hashmap defined, but only one of them can be non-empty:
   ```
   if (attrsArray.nonEmpty) ... else exprIdToOrdinal.get(exprId)).getOrElse(-1)
   ```



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to