zhangfengcdt commented on code in PR #2849:
URL: https://github.com/apache/sedona/pull/2849#discussion_r3125110795


##########
spark/common/src/test/scala/org/apache/sedona/sql/geography/GeographyFunctionTest.scala:
##########
@@ -87,6 +87,15 @@ class GeographyFunctionTest extends TestBaseScala {
         .first()
       assertEquals(3, row.getInt(0))
     }
+
+    it("ST_AsText") {
+      val row = sparkSession
+        .sql("SELECT ST_AsText(ST_GeogFromWKT('POINT (1 2)', 4326)) AS wkt")
+        .first()
+      val wkt = row.getString(0)
+      // S2 round-trip may introduce sub-nanometer floating-point drift
+      assertTrue(s"Expected POINT near (1, 2), got: $wkt", 
wkt.startsWith("POINT ("))
+    }

Review Comment:
   Now, ST_AsText case — parses the WKT and asserts point.getX == 1.0, 
point.getY == 2.0 within 1e-9



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