sekikn commented on code in PR #677:
URL: https://github.com/apache/incubator-sedona/pull/677#discussion_r962244668


##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -70,6 +70,27 @@ public static double length(Geometry geometry) {
         return geometry.getLength();
     }
 
+    public static Double x(Geometry geometry) {

Review Comment:
   ST_X, ST_Y and ST_Z should return null if the first argument is not a Point, 
so we have to check the input type somewhere. I chose to do that in the common 
functions, because if they can direcly return null by using a boxed type, we 
can simply wrap it with InferredUnaryExpression in the Spark SQL functions. But 
as you pointed out, returning boxed type looks somewhat strange. Should I 
change the common functions to return a primitive value? In that case, we have 
to use UnaryGeometryExpression instead of InferredUnaryExpression so the code 
will become a bit verbose. Either is fine with me.



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

Reply via email to