Snowflake ST_Distance and ST_HausdorffDistance throw NullPointerException on an empty geometry
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #3454 by @jiayuasu — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start with the Snowflake UDF overloads in UDFs and UDFsV2, then check how Functions.distance and Functions.hausdorffDistance handle empty geometries and compare the Spark and Flink behavior. Done means both functions return NULL for empty geometries without throwing, and the Hausdorff distance documentation matches that behavior. An open linked pull request (#3454) is already addressing this issue.
Written by the indexing model from the issue text.
Description
The Snowflake UDFs ST_Distance and ST_HausdorffDistance (both overloads, in UDFs and UDFsV2) are declared to return a primitive double, but Functions.distance and Functions.hausdorffDistance return null when either geometry is empty. The unboxing throws a NullPointerException instead of returning NULL, as these functions do in Spark and Flink.
Repro: SELECT sedona.ST_Distance(sedona.ST_GeomFromText('POINT(1 2)'), sedona.ST_GeomFromText('POLYGON EMPTY'))
The ST_HausdorffDistance docs also say an empty geometry gives 0.0, but it has returned NULL since #2730.
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 787
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 52
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/sedona
-
ST_EqualsIdentical returns false for a stored 2D geometry and the same geometry parsed from WKTPossibly taken @jiayuasu claimed this today. Open
Difficulty 3/5 Half a day Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Skip deserialization in ST_EqualsIdentical when both geometry buffers are byte-identicalPossibly taken @jiayuasu claimed this today. Open
Difficulty 3/5 Half a day Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Shaded jar built with -Dgeotools keeps only one JAI-EXT registry filePossibly taken @jiayuasu claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
apache/sedona#3443 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
apache/sedona#3429 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 3/5 1-2 days Newbie friendliness 74/100
apache/sedona#3364 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug new windows
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GantMan/jail-monkey#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/jucs#145 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/lints#1559 ·
Maintainers usually reply within 2 days