[SPARK-59395][SDP] Expose deterministic flow execution attribution - #58749
Open
marcuslin123 wants to merge 1 commit into
Open
[SPARK-59395][SDP] Expose deterministic flow execution attribution#58749marcuslin123 wants to merge 1 commit into
marcuslin123 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds public Spark Declarative Pipelines metadata for correlating a logical flow and an
individual flow execution attempt with the Spark SQL executions and jobs that it launches.
Each flow execution receives a unique UUID. While batch and streaming flows start their Spark
work, the implementation exposes the canonical flow identifier and execution UUID as Spark local
properties and adds a deterministic execution tag. Batch execution also carries the submitting
thread's local properties into the worker thread and restores the worker state afterward.
Why are the changes needed?
Spark Declarative Pipelines currently does not provide a deterministic way for external observers
to attribute Spark SQL executions and jobs to a specific flow attempt. Consumers otherwise need to
infer attribution from text or timestamps, which is ambiguous when flows or attempts overlap.
Does this PR introduce any user-facing change?
Yes. Listeners and event-log consumers can use
PipelineExecutionMetadatato read the logical flowidentifier and unique flow execution ID from Spark job properties, then correlate each job with its
Spark SQL execution ID. The execution ID is also exposed as a Spark job tag and is available on
SparkListenerSQLExecutionStart.How was this patch tested?
Added focused tests for metadata naming, scoped restoration, failure cleanup, batch attribution,
multiple batch attempts, reused worker-thread isolation, streaming attribution, and exact
job-to-SQL-execution correlation.
Ran:
All 28 tests passed, and both production and test Scalastyle checks completed with no errors or
warnings.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5), used for code and test assistance under author direction and
review.