You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2025/10/16 17:27:46 UTC
Re: [PR] feat: Support configurable explain analyze detail level [datafusion]
alamb commented on code in PR #18098:
URL: https://github.com/apache/datafusion/pull/18098#discussion_r2436828504
##########
datafusion/core/tests/sql/explain_analyze.rs:
##########
@@ -158,6 +159,40 @@ async fn explain_analyze_baseline_metrics() {
fn nanos_from_timestamp(ts: &Timestamp) -> i64 {
ts.value().unwrap().timestamp_nanos_opt().unwrap()
}
+
+// Test different detail level for config `datafusion.explain.analyze_level`
+#[tokio::test]
+async fn explain_analyze_level() {
+ async fn collect_plan(level: ExplainAnalyzeLevel) -> String {
+ let mut config = SessionConfig::new();
+ config.options_mut().explain.analyze_level = level;
+ let ctx = SessionContext::new_with_config(config);
+ let sql = "EXPLAIN ANALYZE \
+ SELECT * \
+ FROM generate_series(10) as t1(v1) \
+ ORDER BY v1 DESC";
+ let dataframe = ctx.sql(sql).await.unwrap();
+ let batches = dataframe.collect().await.unwrap();
+ arrow::util::pretty::pretty_format_batches(&batches)
+ .unwrap()
+ .to_string()
+ }
+
+ for (level, needle, should_contain) in [
Review Comment:
nice
##########
datafusion/common/src/config.rs:
##########
@@ -893,6 +893,13 @@ config_namespace! {
/// (format=tree only) Maximum total width of the rendered tree.
/// When set to 0, the tree will have no width limit.
pub tree_maximum_render_width: usize, default = 240
+
+ /// Verbosity level for "EXPLAIN ANALYZE". Default is "dev"
+ /// When setting to "summary", it displays common metrics for high-level
+ /// insights.
+ /// When setting to "dev", it includes deep operator-level introspection for
+ /// developers
Review Comment:
I think you could make this more concise, like
```suggestion
/// "summary" displays common metrics for high-level
/// insights.
/// "dev", includes deep operator-level introspection for
/// developers
```
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org