-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-53760][Geo][SQL] Introduce GeometryType and GeographyType #52491
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkaravel Please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @uros-db for kicking it off! left some comments/questions as i read it
sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/CrsMappings.java
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/DataType.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeographyType.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeometryType.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeographyType.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeometryType.scala
Outdated
Show resolved
Hide resolved
Hi folks, please re-review. @szehon-ho @mkaravel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM. Please take a look at the comments I posted.
Thank you for this PR!
sql/api/src/main/scala/org/apache/spark/sql/types/SpatialReferenceMapper.java
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/SpatialReferenceMapper.java
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/SpatialReferenceMapper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uros-db Thank you for addressing the comments!
LGTM.
@cloud-fan @szehon-ho Please review. Also cc @srielau (we have some new error classes here). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, be nice to document the expectation of the GeographyType and GeometryType argument (what is expected, not expected and only internal), as its a user facing API: ref: #52491 (comment)
Great work. The Apache Sedona team was not aware of or informed by this PR. We are now looking into this. |
We will review and comment on this PR. This is to ensure it does not create incompatibility with Apache Sedona. |
Thank you @jiayuasu. We will hold the merge until you have enough time to review. Please feel free to let me know if you have any questions or concerns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Just a few notes from the GeoArrow/Parquet compatibility angle where most CRSes are written by spatial tools with a PROJJSON or authority:code CRS.
sql/api/src/main/scala/org/apache/spark/sql/types/GeographyType.scala
Outdated
Show resolved
Hide resolved
Hi folks @paleolimbot @jiayuasu, do you have any other concerns about this PR? cc @cloud-fan |
sql/api/src/main/scala/org/apache/spark/sql/types/GeometryType.scala
Outdated
Show resolved
Hide resolved
Thanks. This PR looks good to us! |
Thanks everyone for your reviews! @cloud-fan This PR is ready for your review now. |
sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/internal/types/SpatialReferenceSystemMapper.java
Show resolved
Hide resolved
@cloud-fan This should be ready for merge. |
thanks, merging to master! |
Thank you, @uros-db , @cloud-fan and all. |
What changes were proposed in this pull request?
Introduce two new logical types to Spark:
GeographyType
GeometryType
This PR also adds appropriate SQL parsing and JSON serialization logic for the new types.
Why are the changes needed?
Kicking off https://issues.apache.org/jira/browse/SPARK-51658 by adding GEOMETRY and GEOGRAPHY types to Spark.
Does this PR introduce any user-facing change?
Yes, two new logical data types are added as
Experimental
.How was this patch tested?
Added new tests to:
GeographyTypeSuite
GeometryTypeSuite
Also, added appropriate test cases to:
DataTypeSuite
Was this patch authored or co-authored using generative AI tooling?
No.