Skip to content

[SPARK-52632][SQL] Pretty display V2 write plan nodes #51332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Jul 1, 2025

What changes were proposed in this pull request?

Pretty display V2 write plan nodes by overriding def stringArgs.

Why are the changes needed?

Better UX for UI display and EXPLAIN output

Does this PR introduce any user-facing change?

Yes, change affects UI display and EXPLAIN output for V2 write cases.

How was this patch tested?

Use AppendData as an example.

Before
Xnip2025-07-01_16-39-59
After
Xnip2025-07-01_16-30-00

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

No.

@github-actions github-actions bot added the SQL label Jul 1, 2025
@@ -67,6 +68,7 @@ private[noop] object NoopBatchWrite extends BatchWrite {
override def useCommitCoordinator(): Boolean = false
override def commit(messages: Array[WriterCommitMessage]): Unit = {}
override def abort(messages: Array[WriterCommitMessage]): Unit = {}
override def toString: String = "NoopBatchWrite"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use Utils.getFormattedClassName?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for suggestion, updated

@pan3793
Copy link
Member Author

pan3793 commented Jul 2, 2025

cc @viirya

@@ -367,6 +365,8 @@ trait V2ExistingTableWriteExec extends V2TableWriteExec {
def refreshCache: () => Unit
def write: Write

override val stringArgs: Iterator[Any] = Iterator(query, write)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As query is the child of the plan, it won't be shown by argString, I wonder why we need to put it in stringArgs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that, but other existing overrides also include the child, I just follow that.

for example

case class SubqueryExec(...) {
...
  override def stringArgs: Iterator[Any] = Iterator(name, child) ++ Iterator(s"[id=#$id]")
...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants