You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/02 02:38:38 UTC

[GitHub] [spark] beliefer commented on a change in pull request #31356: [SPARK-34257][SQL] Improve performance for last_value over unbounded window frame

beliefer commented on a change in pull request #31356:
URL: https://github.com/apache/spark/pull/31356#discussion_r568282572



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowFunctionFrame.scala
##########
@@ -500,8 +501,18 @@ final class UnboundedWindowFunctionFrame(
     if (processor != null) {
       processor.initialize(rows.length)
       val iterator = rows.generateIterator()
-      while (iterator.hasNext) {
-        processor.update(iterator.next())
+      if (jumpToEnd) {
+        var lastRow = EmptyRow
+        while (iterator.hasNext) {
+          lastRow = iterator.next()

Review comment:
       `ExternalAppendOnlyUnsafeRowArray` cannot get the last element directly.




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

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



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