Skip to content
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

[SPARK-23330][WebUI] Spark UI SQL executions page throws NPE #20502

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private[ui] abstract class ExecutionTable(
}

private def descriptionCell(execution: SQLExecutionUIData): Seq[Node] = {
val details = if (execution.details.nonEmpty) {
val details = if (execution.details != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Still worth checking for nonEmpty? the behavior may be different in the second change here otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

Seems previously detail link won't be shown for empty details, this change makes it shown anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, we can write Option(execution.details).exist(_.nonEmpty), or simply execution.details != null && execution.details.nonEmpty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about make the default value of details an empty string? Then we don't have to worry about the null case here.

Copy link
Member

Choose a reason for hiding this comment

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

Sure. That could further change the semantics somewhere else, though maybe not in any meaningful way. I suppose it means you can't distinguish empty and unset then. Overall I'd just add the null check here and leave it at that, but don't feel strongly about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about make the default value of details an empty string?

I'd double check how that works with serialization before trying that. Jackson used to have issues with default argument values in case classes, but maybe that's been fixed.

The code suggested by Wenchen is safer, though, and avoids having to do that.

<span onclick="clickDetail(this)" class="expand-details">
+details
</span> ++
Expand All @@ -190,8 +190,10 @@ private[ui] abstract class ExecutionTable(
Nil
}

val desc = {
val desc = if (execution.description != null) {
<a href={executionURL(execution.executionId)}>{execution.description}</a>
} else {
<a href={executionURL(execution.executionId)}>{execution.executionId}</a>
}

<div>{desc} {details}</div>
Expand Down