You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by GitBox <gi...@apache.org> on 2022/09/04 04:03:46 UTC

[GitHub] [incubator-sedona] sekikn commented on a diff in pull request #677: SEDONA-157: Add coordinate accessors to the Flink API

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: dev-unsubscribe@sedona.apache.org

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