René's URL Explorer Experiment


Title: feat(dataframe): expose the executed physical plan with per-operator metrics by LantaoJin · Pull Request #97 · apache/datafusion-java · GitHub

Open Graph Title: feat(dataframe): expose the executed physical plan with per-operator metrics by LantaoJin · Pull Request #97 · apache/datafusion-java

X Title: feat(dataframe): expose the executed physical plan with per-operator metrics by LantaoJin · Pull Request #97 · apache/datafusion-java

Description: Which issue does this PR close? Closes #96 . Rationale for this change df.explain(true, true) already runs the plan and attaches per-operator metrics, but the result is a DataFrame of text rows. Programmatic consumers — query-shape regression tests, operational audit feeds, build-time benchmarks — have to scrape output_rows=12345, elapsed_compute=4.2ms strings out of those rows. Brittle to upstream wording, ergonomically painful, and the typed metric values (Count, Time, Gauge) lose their type along the way. This PR adds a typed accessor df.executedPlan() that returns an immutable ExecutedPlan tree once the DataFrame has been executed via collect() / executeStream(). Each node carries the operator name, a one-line display rendering, child nodes, and an OperatorMetrics POJO with OptionalLong fields for the well-known metric variants plus a Map for custom counters. try (DataFrame df = ctx.sql("SELECT count(*) FROM events"); ArrowReader r = df.collect(allocator)) { while (r.loadNextBatch()) { /* drain */ } } ExecutedPlan plan = df.executedPlan(); long rows = plan.metrics().outputRows().orElse(-1L); The contract is post-mortem: executedPlan() requires a prior collect / executeStream and rejects with IllegalStateException("call collect() or executeStream() first") if called pre-execution. A future PR can extend the surface to make pre-execution structure inspection available too — that follow-up is intentionally out of scope here to keep this PR focused on the metric-snapshot surface. What changes are included in this PR? New public records ExecutedPlan and OperatorMetrics. New DataFrame.executedPlan() method. New proto/executed_plan.proto (ExecutedPlanNodeProto). Native side: executed_plan.rs. Java-side: one new final long planId field assigned at construction. Out of scope (deferred to follow-up PRs): Per-partition metric breakdown. Time/Gauge-shaped custom metrics; v1 surfaces Count-shaped customs only. Are these changes tested? Yes. 10 new tests in the ExecutedPlanTest. Are there any user-facing changes? Yes, additive only -- no behavior changes for existing callers. New public types ExecutedPlan and OperatorMetrics (records). New DataFrame.executedPlan() method.

Open Graph Description: Which issue does this PR close? Closes #96 . Rationale for this change df.explain(true, true) already runs the plan and attaches per-operator metrics, but the result is a DataFrame of text rows. ...

X Description: Which issue does this PR close? Closes #96 . Rationale for this change df.explain(true, true) already runs the plan and attaches per-operator metrics, but the result is a DataFrame of text rows. ...

Opengraph URL: https://github.com/apache/datafusion-java/pull/97

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f7432bdb-cbb9-0060-b94b-47f22e0b3962
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA3EC:3C88CA:23B839:31823C:6B046818
html-safe-nonce351b66d8dcc881ff6f5f3e8ab693393a230fab0d717fea77e5136d453821248f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0VDOjNDODhDQToyM0I4Mzk6MzE4MjNDOjZCMDQ2ODE4IiwidmlzaXRvcl9pZCI6IjYzMDcwMDI4MDQxNTQ0Mjc0MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbb25a2ebdde42d7543eeb2ea5d6838b8065a8189f7c12ab6b700acef658ecfee
hovercard-subject-tagpull_request:3748274570
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/apache/datafusion-java/pull/97/files
twitter:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
og:image:altWhich issue does this PR close? Closes #96 . Rationale for this change df.explain(true, true) already runs the plan and attaches per-operator metrics, but the result is a DataFrame of text rows. ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
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

Links:

Skip to contenthttps://github.com/apache/datafusion-java/pull/97/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F97%2Ffiles
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%2Fpull%2F97%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/pull/97/files
Reloadhttps://github.com/apache/datafusion-java/pull/97/files
Reloadhttps://github.com/apache/datafusion-java/pull/97/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
LantaoJinhttps://github.com/LantaoJin
apache:mainhttps://github.com/apache/datafusion-java/tree/main
LantaoJin:feat/dataframe-executed-planhttps://github.com/LantaoJin/datafusion-java/tree/feat/dataframe-executed-plan
Conversation 0 https://github.com/apache/datafusion-java/pull/97
Commits 1 https://github.com/apache/datafusion-java/pull/97/commits
Checks 0 https://github.com/apache/datafusion-java/pull/97/checks
Files changed https://github.com/apache/datafusion-java/pull/97/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/97/files
feat(dataframe): expose the executed physical plan with per-operator metrics https://github.com/apache/datafusion-java/pull/97/files#top
Show all changes 1 commit https://github.com/apache/datafusion-java/pull/97/files
71c19cc feat(dataframe): expose the executed physical plan with per-operator … LantaoJin May 26, 2026 https://github.com/apache/datafusion-java/pull/97/commits/71c19ccaa74374cd2058ef32c8f4d0c709d2a90e
Clear filters https://github.com/apache/datafusion-java/pull/97/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/97/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/97/files
DataFrame.java https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
ExecutedPlan.java https://github.com/apache/datafusion-java/pull/97/files#diff-0535cdbdf12c1c1a7a464e8c4790099b8e0c1617d0ff2f4e712330a2d7eafc15
OperatorMetrics.java https://github.com/apache/datafusion-java/pull/97/files#diff-9379adba4ab07712369e158bfdc0c8d11c95eac0579f62784bb95b929ec42be4
ExecutedPlanTest.java https://github.com/apache/datafusion-java/pull/97/files#diff-3ba1ff4f8a338883ee08a1c30e15f74414949b05fa35f34a3ebff2ce79b30fd0
dataframe.md https://github.com/apache/datafusion-java/pull/97/files#diff-0db00fdca026f8f4838e5541679d624af285899d06241107e061b5d1223cf2ad
ExecutedPlanExample.java https://github.com/apache/datafusion-java/pull/97/files#diff-1d1050f13b25f47bbb8bbf8380d5e4f4800539065877072e416fcdc994e2e1aa
build.rs https://github.com/apache/datafusion-java/pull/97/files#diff-358ae2245aa2cd99768b0c568a07648d4c26c8cdd84b15cd6f0af2680ec85240
executed_plan.rs https://github.com/apache/datafusion-java/pull/97/files#diff-ab1cc4aa6eb8fdec0a5baffee4626ce19fb05db1baed49d98203b84542bf2709
lib.rs https://github.com/apache/datafusion-java/pull/97/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
executed_plan.proto https://github.com/apache/datafusion-java/pull/97/files#diff-8fb5193b38ec0bd48949e77c101af83c4f09bebc06c43805dc20660acd684e94
core/src/main/java/org/apache/datafusion/DataFrame.javahttps://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
View file https://github.com/apache/datafusion-java/blob/71c19ccaa74374cd2058ef32c8f4d0c709d2a90e/core/src/main/java/org/apache/datafusion/DataFrame.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/97/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/97/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
core/src/main/java/org/apache/datafusion/ExecutedPlan.javahttps://github.com/apache/datafusion-java/pull/97/files#diff-0535cdbdf12c1c1a7a464e8c4790099b8e0c1617d0ff2f4e712330a2d7eafc15
View file https://github.com/apache/datafusion-java/blob/71c19ccaa74374cd2058ef32c8f4d0c709d2a90e/core/src/main/java/org/apache/datafusion/ExecutedPlan.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/97/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/OperatorMetrics.javahttps://github.com/apache/datafusion-java/pull/97/files#diff-9379adba4ab07712369e158bfdc0c8d11c95eac0579f62784bb95b929ec42be4
View file https://github.com/apache/datafusion-java/blob/71c19ccaa74374cd2058ef32c8f4d0c709d2a90e/core/src/main/java/org/apache/datafusion/OperatorMetrics.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/97/{{ revealButtonHref }}
Please reload this pagehttps://github.com/apache/datafusion-java/pull/97/files
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-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.