srowen commented on a change in pull request #31356:
URL: https://github.com/apache/spark/pull/31356#discussion_r567872580
##########
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:
Is there any better way to get the last element in this case than
iterate over all of them? maybe not given the unusual nature of the dat backing
ExternalAppendOnlyUnsafeRowArray
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]