cloud-fan commented on code in PR #59094:
URL: https://github.com/apache/spark/pull/59094#discussion_r4248827071
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproxTopKAggregates.scala:
##########
@@ -905,6 +905,10 @@ case class ApproxTopKCombine(
*/
override def update(buffer: CombineInternal[Any], input: InternalRow):
CombineInternal[Any] = {
val inputState = state.eval(input).asInstanceOf[InternalRow]
+ if (inputState == null) {
+ // A NULL sketch carries no items, so it contributes nothing to the
combined sketch.
+ return buffer
Review Comment:
The new partition test keeps both the live sketch and NULL state BIGINT, so
every stamped partial type agrees. Please use an INT live sketch with a BIGINT
typed NULL branch isolated in a partial; existing SPARK-58164 coverage already
establishes that a BIGINT-widened state with only an INT real sketch is
supported.
<!-- SPARK_DEV_REVIEW_REPLY
{"feedback_id":"inline:4139328077","thread_id":"inline:4139328077","verdict_sha256":"8fd7c5f8f90a68ab25440b76a5bfad9e32460d5c37b3dd38b0dff914c8f94a57"}
-->
--
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]