Enable spatial join for spherical geography ST_Distance#14137
Merged
rschlussel merged 4 commits intoprestodb:masterfrom Mar 25, 2020
Merged
Enable spatial join for spherical geography ST_Distance#14137rschlussel merged 4 commits intoprestodb:masterfrom
rschlussel merged 4 commits intoprestodb:masterfrom
Conversation
Contributor
Author
|
This is a first draft; I'm looking for feedback. cc @mbasmanova @aweisberg @rschlussel |
aweisberg
suggested changes
Feb 25, 2020
Contributor
There was a problem hiding this comment.
Store this enum set as a constant
...geospatial-toolkit/src/main/java/com/facebook/presto/geospatial/SphericalGeographyUtils.java
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Where is the partitioned test?
presto-main/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java
Outdated
Show resolved
Hide resolved
b68cf52 to
d7dca11
Compare
Previously, we did not extract a spatial join for any spherical calculations. This enables joins for `ST_Distance(geog1, geog2) < r` for spherical geographies `geog1` and `geog2` for inner joins. Currently `ST_Distance` for geographies only takes points. Later work can extend to other geographic objects, to outer-type joins, or to other functions (like `ST_Contains`).
1. This reduces the size of GeoFunctions, and keeps spherical functions in one place. 2. SqlTypes Geometry and SphericalGeography have the same Java type (Slice). This makes it impossible to put functions that overload between Geometry and SphericalGeography in one class. With SphericalGeoFunctions, we can overload the SqlTypes in two different classes.
d7dca11 to
b79965b
Compare
Contributor
|
CC: @zhenxiao |
aweisberg
approved these changes
Mar 17, 2020
Contributor
aweisberg
left a comment
There was a problem hiding this comment.
LGTM sorry for the delay!
Contributor
Author
|
@rschlussel Would you mind taking a look, since you know the planner quite well? Thanks! |
rschlussel
approved these changes
Mar 24, 2020
| return null; | ||
| } | ||
|
|
||
| // TODO: support more SphericalGeography types. |
Contributor
There was a problem hiding this comment.
just curious why this todo didn't move.
Contributor
Author
There was a problem hiding this comment.
I'm not sure what the Presto conventions are for comment TODOs. No one is actively working on that, and it seems like an issue is a better place to maintain a record of things to do?
9 tasks
34 tasks
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.
Previously, we did not extract a spatial join for any spherical
calculations. This enables joins for
ST_Distance(geog1, geog2) < rfor spherical geographies
geog1andgeog2for inner joins.Currently
ST_Distancefor geographies only takes points. Laterwork can extend to other geographic objects, to outer-type joins,
or to other functions (like
ST_Contains).