[SEDONA-711] Add Geography user-defined type #1828
Merged
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.
Did you read the Contributor Guide?
Is this PR related to a JIRA ticket?
[SEDONA-711] my subject.What changes were proposed in this PR?
This work is largely based on #1811.
This PR adds a
GeographyUDTto match theGeometryUDT. This matches how the types are defined in Iceberg and Parquet, and maps to the concepts of"edges": "spherical"in GeoParquet and GeoArrow.The newly added
Geographytype that backsGeographyUDTis a simple wrapper around JTS Geometry type. This is for illustrating the idea of how we support Geography types, and does not reflect how we'll actually implement Geography type and spherical computations.We've also enhanced
InferredExpressionto support function overloading with same arity. For instance, we can have the following 2 overloads to support both Geometry and Geography:ST_AsEWKB(geometry) -> binaryST_AsEWKB(geography) -> binaryThe rule for resolving overloaded function is pretty simple for now: it selects the function requiring minimal amount of type coercions. Please refer to
FunctionResolver.resolveFunctionfor details.How was this patch tested?
Added new tests.
Did this PR include necessary documentation updates?
The support for Geography type is not complete yet, so we don't bother updating the documentation for now.