cloud-fan commented on code in PR #43236:
URL: https://github.com/apache/spark/pull/43236#discussion_r1354133451
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowFunctionFrame.scala:
##########
@@ -200,15 +200,19 @@ class FrameLessOffsetWindowFunctionFrame(
override def prepare(rows: ExternalAppendOnlyUnsafeRowArray): Unit = {
resetStates(rows)
- if (ignoreNulls) {
- findNextRowWithNonNullInput()
+ if (Math.abs(offset) > rows.length) {
+ inputIndex = offset
} else {
- // drain the first few rows if offset is larger than zero
- while (inputIndex < offset) {
- if (inputIterator.hasNext) inputIterator.next()
- inputIndex += 1
+ if (ignoreNulls) {
Review Comment:
seems we can just change this to `if (ignoreNulls && Math.abs(offset) >
rows.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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]