yaooqinn opened a new pull request, #55778:
URL: https://github.com/apache/spark/pull/55778
### What changes were proposed in this pull request?
This PR adds an in-graph node search to the SQL execution detail page,
sitting next to the zoom toolbar introduced in SPARK-56792.
Behavior:
- A magnifying-glass button in the plan-viz toolbar (or the `/` keyboard
shortcut while hovering the plan) opens a compact search input with a match
counter and prev/next/close buttons.
- Typing performs a case-insensitive substring match against the operator
name (`SparkPlanGraphNode.name` for plain nodes, `SparkPlanGraphCluster.name`
for WholeStageCodegen clusters).
- Matches are highlighted with an orange outline; the active match is filled
with the existing 'linked' accent color and the viewport is zoomed to fit it.
`Enter` / `Shift+Enter` and the up/down buttons cycle through matches in DOM
order; the viewport pans smoothly.
- Non-matching nodes and clusters are dimmed to opacity 0.3, but a cluster
that contains a match is never dimmed (so the matched child stays visible).
When the query has no matches, the plan is left fully visible and the counter
shows '0/0' in red, mirroring familiar find-in-page UX.
- `Esc` (or the close button) clears the search and collapses the toolbar
without resetting the user's manual zoom/pan position.
- Toggling detailed mode (which re-parses the dot file and rebuilds the SVG)
automatically reapplies the active query against the new DOM.
Implementation notes:
- Matching uses `getNodeDetails()[domId].name` so detailed-mode HTML labels
(which embed metric tables) are not searched as raw HTML.
- Cluster ancestors of a match are tracked via the graphlib instance's
`parent(v)` to drive the 'do not dim' rule.
### Why are the changes needed?
For wide SparkPlans (large joins, AQE plans with many shuffle/exchange
nodes, generated WholeStageCodegen clusters) it is currently hard to locate a
specific operator. With zoom/pan from SPARK-56792 the plan can be navigated,
but the user still needs a way to ask 'where is the BroadcastHashJoin in this
graph?'.
### Does this PR introduce _any_ user-facing change?
Yes. A new search control appears in the SQL execution detail page's
plan-viz toolbar (next to the existing zoom controls). No public APIs, configs,
metrics, or persisted data are affected.
| | basic mode | detailed mode |
| --- | --- | --- |
(I will replace the placeholder image links with real attachments after PR
creation.)
### How was this patch tested?
- `build/sbt sql/Compile/compile sql/scalastyle`
- `dev/lint-js`
- `node --check` on the modified JS
- Manual smoke test with a multi-stage join + aggregate query, verified in
both basic and detailed modes:
- toolbar collapses/expands as expected
- typing 'hash' matches BroadcastHashJoin + HashAggregate (×2), counter
shows 1/3, viewport zooms to first match
- cycling with Enter/up/down updates the active match and pans
- non-matching nodes (Project, Exchange, AQEShuffleRead, LocalTableScan,
BroadcastExchange) dim to 0.3
- the WholeStageCodegen cluster containing matched HashAggregate is not
dimmed
- toggling detailed mode preserves the search
- typing a non-matching string shows '0/0' in red and leaves the plan
fully visible
- Esc clears highlights and collapses the toolbar without resetting the
zoom level
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: GitHub Copilot CLI 1.0.44 with Claude Opus 4.7
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]