beliefer commented on code in PR #50680:
URL: https://github.com/apache/spark/pull/50680#discussion_r2059463091


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowFunctionFrame.scala:
##########
@@ -123,9 +123,12 @@ abstract class OffsetWindowFunctionFrameBase(
   protected val fillDefaultValue = {
     // Collect the expressions and bind them.
     val boundExpressions = Seq.fill(ordinal)(NoOp) ++ 
expressions.toImmutableArraySeq.map { e =>
-      if (e.default == null || e.default.foldable && e.default.eval() == null) 
{
+      if (e.default == null) {
         // The default value is null.
         Literal.create(null, e.dataType)
+      } else if (e.default.foldable) {

Review Comment:
   Yes. The optimizer has already optimized the foldable expressions into 
literals. It means the default expression of Lead/Lag is a literal after 
optimization. But the Lead/Lag is still there.



-- 
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: reviews-unsubscr...@spark.apache.org

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


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

Reply via email to