ericm-db opened a new pull request, #60264:
URL: https://github.com/apache/spark/pull/60264

   ### What changes were proposed in this pull request?
   
   This is one of four PRs that let `DataStreamReader.name()` and SQL 
`IDENTIFIED BY` turn on streaming source evolution for a query without the 
internal config `spark.sql.streaming.queryEvolution.enableSourceEvolution`. 
They are meant to land together, in order:
   
   1. SPARK-61309: check source names against the checkpoint before creating 
sources (#60263)
   2. SPARK-61310: decide source evolution once per query run (this PR)
   3. SPARK-61311: enable source evolution for queries that name a source
   4. SPARK-61312: docs
   
   This PR is stacked on #60263; only its last commit is new.
   
   `MicroBatchExecution` decides once per run whether the query tracks its 
sources by name. The value recorded in the checkpoint wins, and a new query 
takes the config. The decision is:
   
   - written into the query's cloned session (`sparkSessionForStream`), so 
every offset log entry records it under the existing key, and
   - passed to `CheckpointVersionManager.resolveOffsetLogVersion` as 
`sourceEvolutionEnabled`, instead of the version manager reading the config to 
pick the offset log version of a new query.
   
   `CheckpointVersionManager.getFormatVersionFromSession` is removed. Its only 
callers were the two `resolve*` methods, which now call the per-log helpers 
directly.
   
   ### Why are the changes needed?
   
   SPARK-61311 makes naming a source enable source evolution, so the decision 
can differ from the config. Making it once, in one place, lets that PR extend a 
single expression. Keeping it out of the user's session keeps other queries 
unaffected.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. For a new query, the decision equals the config. On restart, the query's 
session already took the recorded value later, when the offset metadata was 
restored.
   
   ### How was this patch tested?
   
   New tests in `OffsetSeqLogSuite`: `resolveOffsetLogVersion` follows the 
argument rather than the config, and a restart keeps the checkpoint's 
positional tracking in the query's session but not in the user's.
   
   ```
   build/sbt 'sql/testOnly *OffsetSeqLogSuite *StreamingSourceEvolutionSuite 
*CommitLogSuite *StreamRelationSuite *StreamingSourceIdentifyingNameSuite'
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   This pull request and its description were written by Isaac.
   


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