Jackie-Jiang commented on code in PR #15349:
URL: https://github.com/apache/pinot/pull/15349#discussion_r2017434665


##########
pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/ScalarFunctions.java:
##########
@@ -267,4 +268,18 @@ public static long gridDistance(long firstH3Index, long 
secondH3Index) {
     }
     return H3Utils.H3_CORE.gridDistance(firstH3Index, secondH3Index);
   }
+
+  /**
+   * Returns all H3 indexes within a specified hexagonal grid distance from a 
given origin index. The function considers
+   * hexagonal traversal rules and accounts for wrapping around pentagons.
+   *
+   * @param origin The starting H3 index from which to compute the grid disk.
+   * @param k      The radius of the disk in hexagonal grid steps.
+   * @return A list of H3 indexes within the specified distance from the 
origin. If the origin is a pentagon, some
+   * distortions may occur due to pentagonal gaps.
+   */
+  @ScalarFunction
+  public static List<Long> gridDisk(long origin, int k) {

Review Comment:
   We want to return `long[]` instead of `List<Long>` here. This is a per row 
function, so let's avoid using stream APIs as they have overhead over old 
fashioned for loop copy



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to