You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2023/06/20 14:49:33 UTC

[spark] branch master updated: [SPARK-44105][SQL] `LastNonNull` should be lazily resolved

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c15fa784dc [SPARK-44105][SQL] `LastNonNull` should be lazily resolved
4c15fa784dc is described below

commit 4c15fa784dc268ac0844771585677a90de2d064f
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Tue Jun 20 07:49:24 2023 -0700

    [SPARK-44105][SQL] `LastNonNull` should be lazily resolved
    
    ### What changes were proposed in this pull request?
    `LastNonNull` should be lazily resolved
    
    ### Why are the changes needed?
    to fix https://github.com/apache/spark/pull/41670/files#r1234805869
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    existing GA and manually check
    
    Closes #41672 from zhengruifeng/ps_fix_last_not_null.
    
    Authored-by: Ruifeng Zheng <ru...@apache.org>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 .../apache/spark/sql/catalyst/expressions/windowExpressions.scala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
index 1b9d232bf8a..50c98c01645 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
@@ -1164,19 +1164,19 @@ case class LastNonNull(input: Expression)
 
   override def dataType: DataType = input.dataType
 
-  private val last = AttributeReference("last", dataType, nullable = true)()
+  private lazy val last = AttributeReference("last", dataType, nullable = true)()
 
   override def aggBufferAttributes: Seq[AttributeReference] = last :: Nil
 
-  override val initialValues: Seq[Expression] = Seq(Literal.create(null, dataType))
+  override lazy val initialValues: Seq[Expression] = Seq(Literal.create(null, dataType))
 
-  override val updateExpressions: Seq[Expression] = {
+  override lazy val updateExpressions: Seq[Expression] = {
     Seq(
       /* last = */ If(IsNull(input), last, input)
     )
   }
 
-  override val evaluateExpression: Expression = last
+  override lazy val evaluateExpression: Expression = last
 
   override def prettyName: String = "last_non_null"
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org