-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add h3_cell_to_latlng #3
Conversation
src/main/java/com/foursquare/presto/h3/CellToLatLngFunction.java
Outdated
Show resolved
Hide resolved
DOUBLE.writeDouble(blockBuilder, latLng.lng); | ||
return blockBuilder.build(); | ||
} catch (Exception e) { | ||
return null; |
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.
For my info: Is it faster to catch the exception, or faster to validate the input?
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.
Catching exceptions is generally very slow. uber/h3-java#107 tracks adding a no-throw API for performance.
try (QueryRunner queryRunner = createQueryRunner()) { | ||
assertQueryResults( | ||
queryRunner, | ||
"SELECT h3_cell_to_latlng(578536630256664575)", |
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.
Nit: Does Presto support any hexidecimal syntax? In general I think we should prefer human-readable cell indexes in tests if possible (easier to debug, etc).
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.
I'm not aware of a way to embed a hex literal integer in Presto SQL. (You could use a string literal and from_base
)
Co-authored-by: Nick Rabinowitz <[email protected]>
No description provided.