You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "iGN5117 (via GitHub)" <gi...@apache.org> on 2023/06/14 21:11:19 UTC

[GitHub] [sedona] iGN5117 commented on a diff in pull request #862: [SEDONA-302] Add ST_Translate

iGN5117 commented on code in PR #862:
URL: https://github.com/apache/sedona/pull/862#discussion_r1230174510


##########
sql/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala:
##########
@@ -1954,4 +1954,22 @@ class functionTestScala extends TestBaseScala with Matchers with GeometrySample
       assertEquals(expected, actual)
     }
   }
+
+  it ("should pass ST_Translate") {
+    val geomTestCases = Map(
+      ("'POINT (1 1 1)'") -> ("'POINT Z(2 2 2)'", "'POINT Z(2 2 1)'"),
+      ("'POLYGON ((1 0, 1 1, 2 1, 2 0, 1 0))'") -> ("'POLYGON ((2 1, 2 2, 3 2, 3 1, 2 1))'", "'POLYGON ((2 1, 2 2, 3 2, 3 1, 2 1))'"),
+      ("'LINESTRING EMPTY'") -> ("'LINESTRING EMPTY'", "'LINESTRING EMPTY'")
+    )
+    for (((geom), expectedResult) <- geomTestCases) {
+      val df = sparkSession.sql(s"SELECT ST_AsText(ST_Translate(ST_GeomFromWKT($geom), 1, 1, 1)) AS geom, " + s"$expectedResult")
+      val dfDefaultValue = sparkSession.sql(s"SELECT ST_AsText(ST_Translate(ST_GeomFromWKT($geom), 1, 1)) AS geom, " + s"$expectedResult")

Review Comment:
   This already has tests for cases with no optional parameter in df 



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