xin-aurora commented on code in PR #50552:
URL: https://github.com/apache/spark/pull/50552#discussion_r2045681544
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowFunctionFrame.scala:
##########
@@ -183,7 +183,8 @@ abstract class OffsetWindowFunctionFrameBase(
override def prepare(rows: ExternalAppendOnlyUnsafeRowArray): Unit = {
resetStates(rows)
if (absOffset > rows.length) {
- fillDefaultValue(EmptyRow)
Review Comment:
> Is it the only place? Seems we should never run `fillDefaultValue` in
`prepare` as the default value can be an expression that references attributes.
I found this is the only place to run `fillDefaultValue` in `prepare`. I
updated the `write` in `FrameLessOffsetWindowFunctionFrame` to call
`fillDefaultValue` as well.
I noticed that the `write` in `UnboundedPrecedingOffsetWindowFunctionFrame`
also relies on `prepare` to handle cases where offset exceeds the window group
size. However, I haven't found a query that triggers this method. It's possible
that `write` in `UnboundedPrecedingOffsetWindowFunctionFrame` also needs to be
updated.
--
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]