dongjoon-hyun commented on PR #60651:
URL: https://github.com/apache/spark/pull/60651#issuecomment-6974312169
Thank you for the review. For the items in the review body:
- The comment of the `ScalaUDF Null Handling` batch now gives the reason
that remains for running the two rules to a fixed point: an attribute can
become nullable after resolution, such as a resolved column of the
null-supplying side of an outer join.
- The PR description now says that the schema can change for a column whose
nullability is recorded during analysis, such as the output of `explode`.
For the decision challenge on streaming restarts, I reproduced it. A
checkpoint written by Spark 4.2.1 for `explode(array(plus1($"a"),
plus1($"b"))).as("v")` grouped by `v` restarts on Spark 4.3.0, but fails with
`STATE_STORE_KEY_SCHEMA_NOT_COMPATIBLE` with this PR, as it stores `v` as
non-nullable. A checkpoint written by Spark 4.3.0 restarts with this PR, as its
key is already nullable. The struct variant also restarts, because the Dataset
is analyzed before `groupBy`, so the field is already nullable on Spark 4.2.1.
I chose the second answer. The PR description and the Structured Streaming
migration guide describe the affected queries and the recovery. Keeping the old
nullability for old checkpoints would also keep the wrong `-1` or `0` keys for
NULL inputs.
--
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]