xiangfu0 commented on code in PR #11731:
URL: https://github.com/apache/pinot/pull/11731#discussion_r1346248107


##########
pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/ScalarFunctions.java:
##########
@@ -56,9 +57,9 @@ public static byte[] stPoint(double x, double y) {
    * @return the created point
    */
   @ScalarFunction(names = {"stPoint", "ST_point"})
-  public static byte[] stPoint(double x, double y, boolean isGeography) {
+  public static byte[] stPoint(double x, double y, Object isGeography) {
     Point point = GeometryUtils.GEOMETRY_FACTORY.createPoint(new Coordinate(x, 
y));
-    if (isGeography) {
+    if (BooleanUtils.toBoolean(isGeography)) {

Review Comment:
   this is our internal boolean util, it can handle number/string/boolean
   ```
   public static boolean toBoolean(Object booleanObject) {
       if (booleanObject == null) {
         return false;
       } else if (booleanObject instanceof String) {
         return BooleanUtils.toBoolean((String) booleanObject);
       } else if (booleanObject instanceof Number) {
         return ((Number) booleanObject).intValue() == INTERNAL_TRUE;
       } else if (booleanObject instanceof Boolean) {
         return (boolean) booleanObject;
       } else {
         throw new IllegalArgumentException("Illegal type for boolean 
conversion: " + booleanObject.getClass());
       }
     }
   ```



-- 
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