Skip to content

Conversation

@simonvandel
Copy link
Contributor

Which issue does this PR close?

Closes #8481.

Rationale for this change

See #8481

What changes are included in this PR?

Adds a new UnnestMetrics struct to collect metrics.

Are these changes tested?

Yes, added a DF test.
I'm not sure if there are better places to have this kind of test.
I saw that there are similar explain-tests for SQL. However, unnest is not yet implemented for SQL.

Are there any user-facing changes?

Yes, additional metrics now show up in EXPLAIN ANALYZE queries.

@github-actions github-actions bot added the core Core DataFusion crate label Dec 9, 2023
@simonvandel simonvandel force-pushed the add-unnest-exec-metrics branch from 2b3f19e to b332399 Compare December 9, 2023 12:56
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you for this contributuion @simonvandel -- very nice 👍

let formatted = arrow::util::pretty::pretty_format_batches(&results)
.unwrap()
.to_string();
assert_contains!(&formatted, "elapsed_compute=");
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

}

#[derive(Clone, Debug)]
struct UnnestMetrics {
Copy link
Contributor

Choose a reason for hiding this comment

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

This has some overlap with BaselineMetrics, it might be able to be combined if you wanted to reduce the code size somewhat

https://docs.rs/datafusion/latest/datafusion/physical_plan/metrics/struct.BaselineMetrics.html

self.num_output_batches,
self.num_output_rows,
self.unnest_time,
produced {} output batches containing {} rows in {}",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnnestExec does not report metrics

3 participants