Jackie-Jiang commented on a change in pull request #7182:
URL: https://github.com/apache/incubator-pinot/pull/7182#discussion_r675207964



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/ScalarFunctions.java
##########
@@ -98,4 +99,15 @@ public static String stAsText(byte[] bytes) {
     GeometryUtils.setGeometry(geometry);
     return GeometrySerializer.serialize(geometry);
   }
+
+  /**
+   * Gets the H3 hexagon address from the location
+   * @param latitude latitude of the location
+   * @param longitude longitude of the location
+   * @param resolution H3 index resolution
+   * @return the H3 index address
+   */
+  public static long getHexagonAddr(double latitude, double longitude, int 
resolution) {

Review comment:
       Annotate with `ScalarFunction`

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/ScalarFunctions.java
##########
@@ -98,4 +99,15 @@ public static String stAsText(byte[] bytes) {
     GeometryUtils.setGeometry(geometry);
     return GeometrySerializer.serialize(geometry);
   }
+
+  /**
+   * Gets the H3 hexagon address from the location
+   * @param latitude latitude of the location
+   * @param longitude longitude of the location
+   * @param resolution H3 index resolution
+   * @return the H3 index address
+   */
+  public static long getHexagonAddr(double latitude, double longitude, int 
resolution) {

Review comment:
       We should also add the scalar function with 2 arguments, where the first 
one is `byte[]` of serialized point

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/ScalarFunctions.java
##########
@@ -98,4 +99,15 @@ public static String stAsText(byte[] bytes) {
     GeometryUtils.setGeometry(geometry);
     return GeometrySerializer.serialize(geometry);
   }
+
+  /**
+   * Gets the H3 hexagon address from the location
+   * @param latitude latitude of the location
+   * @param longitude longitude of the location
+   * @param resolution H3 index resolution
+   * @return the H3 index address
+   */
+  public static long getHexagonAddr(double latitude, double longitude, int 
resolution) {

Review comment:
       We should put longitude before latitude to be consistent with other geo 
functions




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to