Skip to content
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 misc functions - part 1 #33479

Merged
merged 20 commits into from
Jan 10, 2022
Merged

Conversation

bharatnc
Copy link
Contributor

@bharatnc bharatnc commented Jan 8, 2022

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Add new h3 miscellaneous functions: h3DegsToRads, h3RadsToDegs, h3HexAreaKm2, h3CellAreaM2, h3CellAreaRads2.

Detailed description / Documentation draft:

Add new h3 miscellaneous functions: h3DegsToRads, h3RadsToDegs, h3HexAreaKm2, h3CellAreaM2, h3CellAreaRads2 as per: https://h3geo.org/docs/api/misc/

Splitting up adding the functions into smaller PRs so that it's easy to review - will add the remaining misc functions separate PRs.

Related to #17708.

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Jan 8, 2022
@bharatnc bharatnc marked this pull request as ready for review January 9, 2022 05:56
@kitaisreal kitaisreal self-assigned this Jan 9, 2022
Copy link
Collaborator

@kitaisreal kitaisreal left a comment

Choose a reason for hiding this comment

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

Consider to cast argument column to function return type, to avoid virtual calls.

src/Functions/h3CellAreaM2.cpp Outdated Show resolved Hide resolved
src/Functions/h3CellAreaM2.cpp Outdated Show resolved Hide resolved
@kitaisreal kitaisreal merged commit 4ddac56 into ClickHouse:master Jan 10, 2022
@alexey-milovidov
Copy link
Member

alexey-milovidov commented Jan 17, 2022

@bharatnc

What's the purpose of adding h3DegsToRads and h3RadsToDegs?
It looks like it is some special way to convert between degrees to radians.
But there should not be any special ways to do it.

Let's either remove these functions
or introduce new functions DEGREES and RADIANS for SQL compatibility.

@bharatnc
Copy link
Contributor Author

bharatnc commented Jan 17, 2022

@bharatnc

What's the purpose of adding h3DegsToRads and h3RadsToDegs? It looks like it is some special way to convert between degrees to radians. But there should not be any special ways to do it.

Let's either remove these functions (preferred) or intdoduce new functions DEGREES and RADIANS for SQL compatibility.

@alexey-milovidov h3DegsToRads and h3RadsToDegs use the conversion functions exposed by h3 which as far as I can tell don't do anything special but just do the standard conversion from rads to degrees and vice versa. I added it purely for api completeness with what's found in https://h3geo.org/docs/api/misc/. Though I should admit that I did think about adding a generic functions to convert from Degrees to Rads and vice versa for general SQL needs.

I guess I am fine to do either one of these:

  • Remove h3DegsToRads and h3RadsToDegs.
  • Add DEGREES and RADIANS instead.

Probably adding DEGREES and RADIANS could be a better way ?

If we end up removing h3DegsToRads and h3RadsToDegs we can optionally add note in h3 docs to use DEGREES and RADIANS functions in place for h3DegsToRads and h3RadsToDegs as they don't do anything extra special.

@alexey-milovidov
Copy link
Member

Probably adding DEGREES and RADIANS could be a better way?

Yes, let's do it!

@bharatnc
Copy link
Contributor Author

Probably adding DEGREES and RADIANS could be a better way?

Yes, let's do it!

Great, I will work on adding those funcs next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants