xiliang678 commented on PR #60690: URL: https://github.com/apache/spark/pull/60690#issuecomment-7045450221
Thanks, agreed: the restore test below reproduces the restart failure. Done in 6fd36a544bb, as you suggested. It adds `spark.sql.optimizer.nestedColumnAliasing.excludeNondeterministic` (internal, default true; false gives the plans without this PR), records it in the offset log, and treats it as false when a checkpoint does not record it, as `spark.sql.optimizer.avoidDoubleFilterEvalForPythonUDF` does. So an existing streaming query, one restarted from a checkpoint written without this PR, keeps its plans, and with them the bug, until it starts from a new checkpoint, while a new streaming query, stream-stream joins included, and every batch query get the fix. As you noted, a downgrade is not covered: by reading the code, an older version ignores the recorded value and plans with the old rules, so a stream-stream join query that started with this PR, and for which the new plans change what a side of the join outputs, fails to restart, and other queries restart with the bug. 6fd36a5 44bb also removes the migration guide entry, and the title now has [SS]. Tests in a9976d3a69e, in `StreamingInnerJoinBase`: - A stream-stream join query with `a[CAST(rand(0) * 10 AS INT)]._1` restored from a checkpoint written by Spark 4.3.0 (added as `checkpoint-version-4.3.0-streaming-join-nested-field`) runs a new micro-batch, and the left side of the join still outputs two integer columns, as in 4.3.0. At a9976d3a69e, which adds the test before 6fd36a544bb adds the conf, it fails with `STATE_STORE_VALUE_SCHEMA_NOT_COMPATIBLE` in each of its six runs (it also runs in `StreamingInnerJoinV4Suite`). - In a new stream-stream join query, 100 right rows that join a stored left row get more than one value of `a[CAST(rand(0) * 1000 AS INT)]._1`, in each of two micro-batches. On master, the 100 joined rows of the first of them get one value. 6fd36a544bb also adds an `OffsetSeqLogSuite` test of the recorded value and an optimizer test of the plans with the conf false. In temporary tests at 6379eabc612 (the change to the rules without the conf), I also restored 4.3.0 checkpoints of an aggregation over a stream-static join, a dedup over a stream-static join and a streaming limit: they restart, and by that and by reading the code, among the operators where nested column aliasing applies, only a stream-stream join keeps state whose schema the new plans change. Since the recorded false applies to the whole plan, existing queries keep their plans even if that reading misses an operator. This replaces what my earlier comment proposed: letting a stream-stream join query restored from an earlier checkpoint fail to restart, documented in the migration guide. -- 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]
