This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 24af80d3bc more geospatial v2 integration tests (#11741)
24af80d3bc is described below

commit 24af80d3bccdb4c2b86cae392ea022b824db1c1a
Author: Xiang Fu <[email protected]>
AuthorDate: Mon Oct 9 00:31:44 2023 -0700

    more geospatial v2 integration tests (#11741)
---
 .../integration/tests/custom/GeoSpatialTest.java   | 30 ++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git 
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/GeoSpatialTest.java
 
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/GeoSpatialTest.java
index cb292f3109..46ce1c54de 100644
--- 
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/GeoSpatialTest.java
+++ 
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/GeoSpatialTest.java
@@ -309,7 +309,9 @@ public class GeoSpatialTest extends 
CustomDataQueryClusterIntegrationTest {
                   + "b.st_point, "
                   + "b.st_point_1, "
                   + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, -1), b.st_point), "
-                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, 1), b.st_point_1) "
+                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, 1), b.st_point_1), "
+                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, 0), ST_Point(40, 
-40, 0)), "
+                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, 1), ST_Point(40, 
-40, 1)) "
                   + "FROM %s a "
                   + "JOIN %s b "
                   + "ON a.wkt1=b.wkt1 "
@@ -328,6 +330,17 @@ public class GeoSpatialTest extends 
CustomDataQueryClusterIntegrationTest {
             BytesUtils.toBytes(record.get(3).asText()));
         assertEquals(dist1, expectedDist1);
         assertEquals(dist2, expectedDist2);
+
+        double dist3 = record.get(6).doubleValue();
+        double dist4 = record.get(7).doubleValue();
+        Point point = GeometryUtils.GEOMETRY_FACTORY.createPoint(new 
Coordinate(40, -40));
+        double expectedDist3 =
+            
ScalarFunctions.stDistance(BytesUtils.toBytes(record.get(0).asText()), 
GeometrySerializer.serialize(point));
+        GeometryUtils.setGeography(point);
+        double expectedDist4 =
+            
ScalarFunctions.stDistance(BytesUtils.toBytes(record.get(1).asText()), 
GeometrySerializer.serialize(point));
+        assertEquals(dist3, expectedDist3);
+        assertEquals(dist4, expectedDist4);
       }
     }
     {
@@ -338,7 +351,9 @@ public class GeoSpatialTest extends 
CustomDataQueryClusterIntegrationTest {
                   + "b.st_point, "
                   + "b.st_point_1, "
                   + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, false), b.st_point), 
"
-                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, true), b.st_point_1) 
"
+                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, true), 
b.st_point_1), "
+                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, false), ST_Point(40, 
-40, false)), "
+                  + "ST_DISTANCE(ST_Point(a.st_x, a.st_y, true), ST_Point(40, 
-40, true)) "
                   + "FROM %s a "
                   + "JOIN %s b "
                   + "ON a.wkt1=b.wkt1 "
@@ -357,6 +372,17 @@ public class GeoSpatialTest extends 
CustomDataQueryClusterIntegrationTest {
             BytesUtils.toBytes(record.get(3).asText()));
         assertEquals(dist1, expectedDist1);
         assertEquals(dist2, expectedDist2);
+
+        double dist3 = record.get(6).doubleValue();
+        double dist4 = record.get(7).doubleValue();
+        Point point = GeometryUtils.GEOMETRY_FACTORY.createPoint(new 
Coordinate(40, -40));
+        double expectedDist3 =
+            
ScalarFunctions.stDistance(BytesUtils.toBytes(record.get(0).asText()), 
GeometrySerializer.serialize(point));
+        GeometryUtils.setGeography(point);
+        double expectedDist4 =
+            
ScalarFunctions.stDistance(BytesUtils.toBytes(record.get(1).asText()), 
GeometrySerializer.serialize(point));
+        assertEquals(dist3, expectedDist3);
+        assertEquals(dist4, expectedDist4);
       }
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to