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-39234][SQL] Code clean up in SparkThrowableHelper.getMessage #36612

Closed
wants to merge 4 commits into from

Conversation

gengliangwang
Copy link
Member

What changes were proposed in this pull request?

  1. Remove the starting "\n" in Origin.context. The "\n" will be append in the method SparkThrowableHelper.getMessage instead.
  2. Code clean up the method SparkThrowableHelper.getMessage to eliminate redundant code.

Why are the changes needed?

Code clean up to eliminate redundant code.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing UT

errorInfo.messageFormat + errorSubInfo.messageFormat)
}
val displayMessage = String.format(
displayFormat.replaceAll("<[a-zA-Z0-9_-]+>", "%s"),
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we avoid writing .replaceAll("<[a-zA-Z0-9_-]+>", "%s") twice

@MaxGekk
Copy link
Member

MaxGekk commented May 19, 2022

+1, LGTM. Merging to master.
Thank you, @gengliangwang and @cloud-fan for review.

@MaxGekk MaxGekk closed this in ebd916b May 19, 2022
gengliangwang added a commit to gengliangwang/spark that referenced this pull request May 25, 2022
1. Remove the starting "\n" in `Origin.context`. The "\n" will be append in the method `SparkThrowableHelper.getMessage` instead.
2. Code clean up the method SparkThrowableHelper.getMessage to eliminate redundant code.

Code clean up to eliminate redundant code.

No

Existing UT

Closes apache#36612 from gengliangwang/moveNewLine.

Authored-by: Gengliang Wang <gengliang@apache.org>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants