From 285f7a93dca9bfb5f5ca9e87a7e86ddf1c0c304c Mon Sep 17 00:00:00 2001 From: Nilesh Gajwani Date: Fri, 23 Jun 2023 18:02:41 -0700 Subject: [PATCH] Add flink test case --- .../java/org/apache/sedona/flink/FunctionTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java b/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java index e49172a3a3..7f8e247828 100644 --- a/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java +++ b/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java @@ -745,4 +745,14 @@ public void testBoundingDiagonal() { assertEquals(expected, actual); } + @Test + public void testAngle() { + Table polyTable = tableEnv.sqlQuery("SELECT ST_Angle(ST_GeomFromWKT('LINESTRING (0 0, 1 1)'), ST_GeomFromWKT('LINESTRING (0 0, 3 2)'))" + " AS " + polygonColNames[0]); + polyTable = polyTable.select(call(Functions.ST_Degrees.class.getSimpleName(), $(polygonColNames[0]))); + Double expected = 11.309932474020195; + Double actual = (Double) first(polyTable).getField(0); + assertEquals(expected, actual, 1e-9); + + } + }