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 apache#45753 from LuciferYang/minor-getOrElse.

Authored-by: yangjie01 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
LuciferYang authored and sweisdb committed Apr 1, 2024
1 parent 7f94e39 commit 7976ec9
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 7976ec9

Please sign in to comment.