Skip to content

Enable spatial join for spherical geography ST_Distance#14137

Merged
rschlussel merged 4 commits intoprestodb:masterfrom
jagill:enable_spherical_geometry_joins
Mar 25, 2020
Merged

Enable spatial join for spherical geography ST_Distance#14137
rschlussel merged 4 commits intoprestodb:masterfrom
jagill:enable_spherical_geometry_joins

Conversation

@jagill
Copy link
Contributor

@jagill jagill commented Feb 21, 2020

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).

== RELEASE NOTES ==

General Changes
* Enable spatial joins for `ST_Distance(p1, p2) < r` for spherical geography points `p1` and `p2`.

@jagill
Copy link
Contributor Author

jagill commented Feb 21, 2020

This is a first draft; I'm looking for feedback. cc @mbasmanova @aweisberg @rschlussel

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Store this enum set as a constant

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, also test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the partitioned test?

@jagill jagill force-pushed the enable_spherical_geometry_joins branch 2 times, most recently from b68cf52 to d7dca11 Compare March 3, 2020 00:52
jagill added 4 commits March 10, 2020 15:05
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.
@jagill jagill force-pushed the enable_spherical_geometry_joins branch from d7dca11 to b79965b Compare March 10, 2020 23:33
@mbasmanova
Copy link
Contributor

CC: @zhenxiao

Copy link
Contributor

@aweisberg aweisberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM sorry for the delay!

@jagill
Copy link
Contributor Author

jagill commented Mar 20, 2020

@rschlussel Would you mind taking a look, since you know the planner quite well? Thanks!

return null;
}

// TODO: support more SphericalGeography types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious why this todo didn't move.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@rschlussel rschlussel merged commit 7af7880 into prestodb:master Mar 25, 2020
@caithagoras caithagoras mentioned this pull request Mar 29, 2020
9 tasks
@jagill jagill deleted the enable_spherical_geometry_joins branch April 24, 2020 13:23
@caithagoras caithagoras mentioned this pull request May 4, 2020
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants