cloud-fan commented on a change in pull request #28685:
URL: https://github.com/apache/spark/pull/28685#discussion_r469920074



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowExecBase.scala
##########
@@ -137,7 +137,11 @@ trait WindowExecBase extends UnaryExecNode {
           function match {
             case AggregateExpression(f, _, _, _, _) => collect("AGGREGATE", 
frame, e, f)
             case f: AggregateWindowFunction => collect("AGGREGATE", frame, e, 
f)
-            case f: OffsetWindowFunction => collect("OFFSET", frame, e, f)
+            case f: OffsetWindowFunction => if (f.isWholeBased) {

Review comment:
       are we going to add more functions like `NthValue`? If not I think it's 
simpler to do
   
   ```
   case f: NthValue => collect("WHOLE_OFFSET", frame, e, f)
   case f: OffsetWindowFunction => collect("OFFSET", frame, e, f)
   ```
   
   so that we don't need to add the `isWholeBased` API.




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

Reply via email to