René's URL Explorer Experiment


Title: feat(dataframe): expose the executed physical plan with per-operator metrics · Issue #96 · apache/datafusion-java · GitHub

Open Graph Title: feat(dataframe): expose the executed physical plan with per-operator metrics · Issue #96 · apache/datafusion-java

X Title: feat(dataframe): expose the executed physical plan with per-operator metrics · Issue #96 · apache/datafusion-java

Description: Is your feature request related to a problem or challenge? Today there are two ways to inspect the physical plan of a DataFrame, and neither is suitable for programmatic consumption: df.explain(false, false) / df.explain(true, false) -- ...

Open Graph Description: Is your feature request related to a problem or challenge? Today there are two ways to inspect the physical plan of a DataFrame, and neither is suitable for programmatic consumption: df.explain(fal...

X Description: Is your feature request related to a problem or challenge? Today there are two ways to inspect the physical plan of a DataFrame, and neither is suitable for programmatic consumption: df.explain(fal...

Opengraph URL: https://github.com/apache/datafusion-java/issues/96

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(dataframe): expose the executed physical plan with per-operator metrics","articleBody":"### Is your feature request related to a problem or challenge?\n\nToday there are two ways to inspect the physical plan of a `DataFrame`, and neither is suitable for programmatic consumption:\n\n1. **`df.explain(false, false)` / `df.explain(true, false)`** -- return a `DataFrame` of text rows describing the lazy logical plan (and optimised + physical plans when `verbose=true`). Pre-execution. No metrics.\n2. **`df.explain(true, true)`** -- runs the plan, then returns a `DataFrame` of text rows that includes per-operator metrics rendered as a string. Post-execution. Metrics are present but only as text -- `output_rows=12345, elapsed_compute=4.2ms` etc.\n\nBoth surface the plan as text rows. To answer \"did this query produce more output rows than the last run?\" or \"which operator spilled?\" today, callers run `df.explain(true, true).collect()` and *parse the strings*. Brittle to upstream wording, ergonomically painful, and the metric values lose their type.\n\nDataFusion's Rust API exposes the underlying structure already: `Arc\u003cdyn ExecutionPlan>` is a tree whose nodes have typed `metrics() -> Option\u003cMetricsSet>` accessors. The values are typed `Count`, `Time`, `Gauge`, `Timestamp`. None of that survives the trip into the existing `EXPLAIN` text. The gap is purely on the Java surface -- pre-execution and post-execution.\n\n### Describe the solution you'd like\n\nA new `DataFrame.executedPlan()` returning a small immutable POJO tree, modelled on Spark's `df.queryExecution.executedPlan`:\n\n```java\nrecord ExecutedPlan(\n    String name,                       // \"HashAggregateExec\" / \"DataSourceExec\" / etc.\n    String displayDetails,             // single-line rendering, e.g. \"filter=x > 1\"\n    List\u003cExecutedPlan> children,\n    OperatorMetrics metrics) { }\n\nrecord OperatorMetrics(\n    OptionalLong outputRows,           // OutputRows summed across partitions; absent if the operator doesn't track this\n    OptionalLong elapsedComputeNanos,  // ElapsedCompute summed across partitions\n    OptionalLong outputBytes,\n    OptionalLong outputBatches,\n    OptionalLong spillCount,\n    OptionalLong spilledBytes,\n    OptionalLong spilledRows,\n    OptionalLong currentMemoryUsage,   // peak / latest Gauge value\n    Map\u003cString, Long> customCounters) {  // any MetricValue::Count(name) the operator emits\n}\n```\n\n`executedPlan()` is **lazy** -- the call itself does not execute the query. It plans the DataFrame (forcing optimisation if not yet done) and returns a snapshot of the physical plan tree. Calling it before `collect()` / `executeStream()` returns the structure with zero-valued metrics. Calling it after returns the same structure with populated metrics. This matches Spark's shape: `df.queryExecution.executedPlan` is always available, and each node's `metrics` map fills in as the plan runs.\n\nTo make \"same plan, before-and-after\" work end-to-end, the native side stashes the planned `Arc\u003cdyn ExecutionPlan>` on the DataFrame handle. `collect()` and `executeStream()` use that stashed plan if present (instead of creating a new one each call). After execution, a second `executedPlan()` call returns the same tree with metrics populated -- by reference to the same plan -- not a freshly-replanned tree.\n\n```java\ntry (DataFrame df = ctx.sql(\"SELECT count(*) FROM events WHERE ts > '2026-01-01'\")) {\n    ExecutedPlan before = df.executedPlan();              // structure, zero metrics\n    System.out.println(before.name());                    // \"AggregateExec\"\n    System.out.println(before.children().get(0).name());  // \"DataSourceExec\"\n\n    try (BufferAllocator alloc = new RootAllocator();\n         ArrowReader r = df.collect(alloc)) {\n        while (r.loadNextBatch()) { /* ... */ }\n    }\n\n    ExecutedPlan after = df.executedPlan();               // same tree, populated metrics\n    long rows = after.children().get(0).metrics().outputRows().orElse(-1L);\n}\n```\n\n### Describe alternatives you've considered\n\n**Parse the text from `df.explain(true, true)`.** Cheapest implementation — no native API changes — but brittle to upstream wording. The whole motivation here is to avoid string-scraping.\n\n**Faithful 1:1 mirror of `MetricValue` variants.** A Java sealed type with one variant per upstream variant. More expressive, but pins the Java API to upstream's variant set; every DataFusion bump risks an API break. Going with the fixed set + `customCounters` map keeps the Java contract stable; the named getters cover every well-known variant, the map covers everything else.\n\n**Bundle into the existing `explain` text output.** Add structured metrics columns to the EXPLAIN-output DataFrame. Doesn't help the parsing problem; would need a separate type to carry typed values anyway.\n\n**Eager getter that runs the query if not already run.** `df.executedPlan()` would internally trigger materialisation when called before `collect()`. Surprising — a getter doing real work — and conflicts with the documented \"non-consuming\" pattern of the other introspection methods (`schema`, `explain`, `cache`, `describe`).\n\n### Additional context\n\n_No response_","author":{"url":"https://github.com/LantaoJin","@type":"Person","name":"LantaoJin"},"datePublished":"2026-05-26T08:10:13Z","url":"https://github.com/apache/datafusion-java/issues/96"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:adef78de-66aa-2a07-e3c9-b00a3bec96da
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC3F2:21700E:21B124:2E7811:6B0467EE
html-safe-nonce0d6668f72b769c02d453d13dc79bef082d5276fe8c788fb1768b26dfe6b2cf2a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0YyOjIxNzAwRToyMUIxMjQ6MkU3ODExOjZCMDQ2N0VFIiwidmlzaXRvcl9pZCI6IjgzOTU1MDgwNTE0NDAwNjg1OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac124014b4b137182e3082a4443c50de33c5c2c4857a4fe499fcab2d91a0ea2094
hovercard-subject-tagissue:4522561818
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/datafusion-java/96/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c3f244edab48d943ae6ceb9e51b6d7e5d957f066110e34b8628b3316a135240a/apache/datafusion-java/issues/96
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c3f244edab48d943ae6ceb9e51b6d7e5d957f066110e34b8628b3316a135240a/apache/datafusion-java/issues/96
og:image:altIs your feature request related to a problem or challenge? Today there are two ways to inspect the physical plan of a DataFrame, and neither is suitable for programmatic consumption: df.explain(fal...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameLantaoJin
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
go-importgithub.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id1237105117
octolytics-dimension-repository_nwoapache/datafusion-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1237105117
octolytics-dimension-repository_network_root_nwoapache/datafusion-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/apache/datafusion-java/issues/96#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fissues%2F96
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fissues%2F96
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/issues/96
Reloadhttps://github.com/apache/datafusion-java/issues/96
Reloadhttps://github.com/apache/datafusion-java/issues/96
apachehttps://github.com/apache
datafusion-javahttps://github.com/apache/datafusion-java
Codehttps://github.com/apache/datafusion-java
Issues10 (10)https://github.com/apache/datafusion-java/issues
Pull requests10 (10)https://github.com/apache/datafusion-java/pulls
Discussionshttps://github.com/apache/datafusion-java/discussions
Actionshttps://github.com/apache/datafusion-java/actions
Security and qualityhttps://github.com/apache/datafusion-java/security
Insightshttps://github.com/apache/datafusion-java/insights
https://github.com/apache/datafusion-java
New issuehttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/96
New issuehttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/96
Featurehttps://github.com/apache/datafusion-java/issues?q=type:"Feature"
#97https://github.com/apache/datafusion-java/pull/97
feat(dataframe): expose the executed physical plan with per-operator metricshttps://github.com/apache/datafusion-java/issues/96#top
#97https://github.com/apache/datafusion-java/pull/97
enhancementNew feature or requesthttps://github.com/apache/datafusion-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/LantaoJin
LantaoJinhttps://github.com/LantaoJin
on May 26, 2026https://github.com/apache/datafusion-java/issues/96#issue-4522561818
LantaoJinhttps://github.com/LantaoJin
enhancementNew feature or requesthttps://github.com/apache/datafusion-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
on May 26, 2026https://github.com/apache/datafusion-java/issues/96#event-25957811857
LantaoJinhttps://github.com/LantaoJin
Featurehttps://github.com/apache/datafusion-java/issues?q=type:"Feature"
on May 26, 2026https://github.com/apache/datafusion-java/issues/96#event-25957812346
Sign up for freehttps://github.com/signup?return_to=https://github.com/apache/datafusion-java/issues/96
Sign in to commenthttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/96
enhancementNew feature or requesthttps://github.com/apache/datafusion-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
Featurehttps://github.com/apache/datafusion-java/issues?q=type:"Feature"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.