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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/package.scala:
##########
@@ -95,23 +93,57 @@ package object expressions  {
       StructType(attrs.map(a => StructField(a.name, a.dataType, a.nullable, 
a.metadata)))
     }
 
+    // Compute min and max expression IDs in a single pass
+    @transient private lazy val minMaxExprId: (Long, Long) = {

Review Comment:
   The general idea LGTM, but we should be prepared for the worst case. I think 
we should fallback to the hash map approach if: 1. `max - min` exceed Int.Max. 
2. `max - min` is 50% (or other reasonable ratio) larger than `attrs.length`.



-- 
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