Skip to content

fix(datafusion): preserve Delta planning count metrics - #24

Merged
radustoenescu merged 2 commits into
main-1.0-statsfrom
fix/planning-metric-serialization-head
Sep 30, 2026
Merged

radustoenescu merged 2 commits into
main-1.0-statsfrom
fix/planning-metric-serialization-head

Conversation

@radustoenescu

Copy link
Copy Markdown
Collaborator

Distributed EXPLAIN ANALYZE loses Delta scan planning counts when physical plans are serialized.

This carries named planning counters through the classic and Next scan codecs and marks restored copies as coordinator-owned so distributed execution can report them once.

Tested with the planning-count wire test, codec round trip, and Cobweb classic/Next integration coverage.

@radustoenescu

Copy link
Copy Markdown
Collaborator Author

Prior to merging I will fix the commit title to use our conventions

@aditanase aditanase left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

fn try_from(exec: &DeltaScanExec) -> Result<Self, Self::Error> {
let scan_plan_wire = scan_plan_wire(&exec.scan_plan)?;
let metrics = exec.metrics().ok_or_else(|| {
DataFusionError::Internal("DeltaScanExec did not expose its metrics".to_string())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to fail on missing metrics? or just return empty

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's probably better not to fail the query due to missing metrics, although that should never happen.

Comment on lines +12 to +13
const DFD_AGGREGATION_SCOPE_LABEL: &str = "dfd_aggregation_scope";
const COORDINATOR_AGGREGATION_SCOPE: &str = "coordinator";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created_at: planning

@radustoenescu
radustoenescu merged commit 1adc29c into main-1.0-stats Sep 30, 2026
2 of 3 checks passed
@radustoenescu
radustoenescu deleted the fix/planning-metric-serialization-head branch September 30, 2026 13:13
radustoenescu pushed a commit that referenced this pull request Oct 22, 2026
…zation (#24, #26)

Preserve planning-time count metrics when serializing classic and next Delta scans, with a shared configuration controlling both encoding and decoding. Keep serialization enabled by default; disable it for execution-only worker plans so coordinator-owned counters are not multiplied across tasks.

Introduce the final codec implementation directly, without the intermediate created_at=planning label mechanism. Consolidates b9b71be and ebd748a; the resulting repository tree is unchanged from ebd748a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants