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 useful H3 functions #14703

Open
Tracked by #14731
bziobrowski opened this issue Dec 23, 2024 · 6 comments
Open
Tracked by #14731

Add useful H3 functions #14703

bziobrowski opened this issue Dec 23, 2024 · 6 comments
Assignees

Comments

@bziobrowski
Copy link
Collaborator

Currently Apache Pinot makes use of H3 only in certain scenarios, e.g. to speed up predicates using st_distance function against h3-indexed points.
To fully utilize it, it should expose more functions available in com.uber.h3core.H3Core class, especially:

  • gridDistance()
  • gridDisk()
  • geoToH3()

Example:

Assuming there's stores table with h3_pos long column (with inverted index) storing h3 index value (at resolution 8) of store's position, we could query for stores in closest 4 rings to given coordinates with:

select * 
from stores
where h3_pos in gridDisk( geoToH3(10.1, 20.3, 8), 4 )

or

select * 
from stores
where h3Distance(h3_pos, geoToH3(10.1, 20.3, 8) ) <= 4

There are many more functions that could be useful for expressing logic in terms of hexagons and hexagon distance that really suit H3.

See:
https://h3geo.org/docs/api/traversal
https://github.com/uber/h3-java/blob/master/src/main/java/com/uber/h3core/H3Core.java

@meshari343
Copy link

Hi, I would like to take on this issue, can someone please assign it to me, and if possible guide me towards the modules I need to work on.

@Jackie-Jiang
Copy link
Contributor

@bziobrowski I guess we should submit this issue to h3 repo because we are asking for these functionalities from their end

@meshari343
Copy link

@Jackie-Jiang those functionalities are already implemented in h3 repo, we just need to integrated within Pinot.

@Jackie-Jiang
Copy link
Contributor

@meshari343 I see. Assigned it to you. Let us know if you need more help, thanks!

@ashishjayamohan
Copy link
Contributor

@meshari343 Are you still working on this? If not, can I take a crack at it?

@meshari343
Copy link

@ashishjayamohan , I still haven’t fully understood the design of the system, but since you’re interested on this issue then sure you’re more than welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants