Skip to content

[SPARK-56331][UI] Truncate long node labels in SQL plan visualization#55156

Draft
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-56331
Draft

[SPARK-56331][UI] Truncate long node labels in SQL plan visualization#55156
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-56331

Conversation

@yaooqinn
Copy link
Copy Markdown
Member

@yaooqinn yaooqinn commented Apr 2, 2026

What changes were proposed in this pull request?

Truncate DOT graph node labels to 36 characters using middle-ellipsis when node names are long (e.g., scan nodes with fully-qualified catalog.schema.table paths from custom catalogs).

The full name remains available in:

  • Tooltip (hover over the node)
  • Side panel (click the node)

Example:

Before: ScanTransformer parquet spark_catalog.longschemaname.catalog_sales  (60+ chars)
After:  ScanTransformer pa…catalog_sales  (36 chars)

Why are the changes needed?

When custom catalogs generate long schema/table identifiers, the plan visualization graph becomes excessively wide and hard to read. Most operator labels are under 30 characters; only scan nodes with fully-qualified paths exceed 36 characters.

Does this PR introduce any user-facing change?

Yes. Long node labels in the SQL plan visualization are now truncated with a middle ellipsis. The full name is still accessible via tooltip and side panel.

How was this patch tested?

  • Updated existing test for truncated label in DOT output
  • Added 4 new tests:
    • Short labels unchanged (Sort, Filter, HashAggregate, null, empty)
    • Long labels truncated with middle ellipsis (boundary, realistic scan names)
    • DOT label truncated while tooltip keeps full name
    • JSON side panel details keep full untruncated name

All 6 tests pass in SparkPlanGraphSuite.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GitHub Copilot (Claude Opus 4.6)

@yaooqinn yaooqinn marked this pull request as draft April 2, 2026 07:39
@yaooqinn yaooqinn force-pushed the SPARK-56331 branch 2 times, most recently from 2aa5247 to de88bc1 Compare April 2, 2026 08:38
@yaooqinn
Copy link
Copy Markdown
Member Author

yaooqinn commented Apr 3, 2026

image

Truncate DOT graph node labels to 36 characters using middle-ellipsis
to prevent the plan visualization from becoming excessively wide when
node names contain long fully-qualified catalog.schema.table paths.

The full name remains available in the tooltip (hover) and the side
panel details (click).

Example:
  Before: ScanTransformer parquet spark_catalog.longschema.catalog_sales
  After:  ScanTransformer pa…catalog_sales

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant