[SPARK-55640][Geo][SQL] Propagate WKB parsing errors for Geometry and Geography#54424
Open
uros-db wants to merge 3 commits intoapache:masterfrom
Open
[SPARK-55640][Geo][SQL] Propagate WKB parsing errors for Geometry and Geography#54424uros-db wants to merge 3 commits intoapache:masterfrom
uros-db wants to merge 3 commits intoapache:masterfrom
Conversation
uros-db
commented
Feb 23, 2026
Contributor
Author
uros-db
left a comment
There was a problem hiding this comment.
Please review @cloud-fan @szehon-ho.
szehon-ho
reviewed
Feb 24, 2026
| ByteBuffer.wrap(bytes).order(DEFAULT_ENDIANNESS).putInt(srid); | ||
| System.arraycopy(wkb, 0, bytes, WKB_OFFSET, wkb.length); | ||
| return fromBytes(bytes); | ||
| } catch (WkbParseException e) { |
Member
There was a problem hiding this comment.
curious, we do not keep the wkb string as hex, it is by design? I find it useful for debugging, but curious
cloud-fan
reviewed
Feb 24, 2026
| * Exception thrown when parsing WKB data fails. | ||
| */ | ||
| class WkbParseException extends RuntimeException { | ||
| public class WkbParseException extends RuntimeException { |
Contributor
There was a problem hiding this comment.
shall we just extend SparkRuntimeException here and specify the error condition name? then we don't need try-catch to rethrow the error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
WKB reader was implemented for Geometry and Geography, but only using internal exception handling. This PR addresses this by introducing proper user-facing error classes for WKB parsing.
Why are the changes needed?
Propagate the WKB parsing errors properly to the user.
Does this PR introduce any user-facing change?
Yes, users now get proper errors for invalid WKB parsing.
How was this patch tested?
Added new unit tests and end-to-end SQL tests for WKB parsing.
Was this patch authored or co-authored using generative AI tooling?
No.