HeartSaVioR commented on code in PR #47134:
URL: https://github.com/apache/spark/pull/47134#discussion_r1665083991


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/MergingSessionsIterator.scala:
##########
@@ -118,7 +118,9 @@ class MergingSessionsIterator(
       val inputRow = inputIterator.next()
       nextGroupingKey = groupingWithoutSessionProjection(inputRow).copy()
       val session = sessionProjection(inputRow)
-      nextGroupingSession = session.getStruct(0, 2).copy()
+      val groupingSession = session.getStruct(0, 2)

Review Comment:
   1. We have another place to have the same possibility of NPE, 
processCurrentSortedGroup(). We may want to extract the logic to apply the same 
to both places.
   2. I guess it's OK to set errorOnIterator = true and throw internalError 
"here" instead of wrapping the call of initialize() with try-catch.



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