Skip to content

Commit

Permalink
[MINOR][CORE] Replace get+getOrElse with getOrElse with default v…
Browse files Browse the repository at this point in the history
…alue in `StreamingQueryException`

### What changes were proposed in this pull request?
This PR replaces `get + getOrElse` with `getOrElse` with a default value in `StreamingQueryException`.

### Why are the changes needed?
Simplify code

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Pass GitHub Actions

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

Closes #45753 from LuciferYang/minor-getOrElse.

Authored-by: yangjie01 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
LuciferYang authored and dongjoon-hyun committed Mar 28, 2024
1 parent 4b58a63 commit 32e73dd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class StreamingQueryException private[sql](
errorClass: String,
messageParameters: Map[String, String]) = {
this(
messageParameters.get("queryDebugString").getOrElse(""),
messageParameters.getOrElse("queryDebugString", ""),
message,
cause,
messageParameters.get("startOffset").getOrElse(""),
messageParameters.get("endOffset").getOrElse(""),
messageParameters.getOrElse("startOffset", ""),
messageParameters.getOrElse("endOffset", ""),
errorClass,
messageParameters)
}
Expand Down

0 comments on commit 32e73dd

Please sign in to comment.