jubins commented on code in PR #59094:
URL: https://github.com/apache/spark/pull/59094#discussion_r4138807420


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ApproxTopKExpressions.scala:
##########
@@ -109,6 +109,9 @@ case class ApproxTopKEstimate(state: Expression, k: 
Expression)
     ApproxTopK.checkExpressionNotNull(k, "k")
     // eval
     val stateEval = left.eval(input)
+    if (stateEval == null) {

Review Comment:
   good catch, fixed NULL-state regression and added tests covering foldable 
and row-evaluated NULL states.



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

Reply via email to