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

dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-connect-swift.git


The following commit(s) were added to refs/heads/main by this push:
     new c97e125  [SPARK-57084] Add `geometry` and `geography` SQL tests and 
answer files
c97e125 is described below

commit c97e125ac1b7cf6ef20e803b070dc8c45213081d
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Tue May 26 12:04:41 2026 -0700

    [SPARK-57084] Add `geometry` and `geography` SQL tests and answer files
    
    ### What changes were proposed in this pull request?
    
    This PR aims to add `geometry.sql` and `geography.sql` test queries for the 
new `GEOMETRY` and `GEOGRAPHY` geospatial types enabled by default in Apache 
Spark 4.2.
    - https://github.com/apache/spark/pull/55734
    
    ### Why are the changes needed?
    
    Apache Spark 4.2 enabled new geospatial types (`GEOMETRY` and `GEOGRAPHY`) 
by default. We need test coverage for these types in the Swift client.
    
    - https://spark.apache.org/docs/4.2.0-preview5/sql-ref-geospatial-types.html
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs with the newly added test queries. The 
`spark.sql.geospatial.enabled=true` configuration is enabled in the Spark 4.2 
integration test jobs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 4.7
    
    Closes #392 from dongjoon-hyun/SPARK-57084.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .github/workflows/build_and_test.yml                           | 3 ++-
 Tests/SparkConnectTests/Resources/queries/geography.sql        | 1 +
 Tests/SparkConnectTests/Resources/queries/geography.sql.answer | 5 +++++
 Tests/SparkConnectTests/Resources/queries/geometry.sql         | 1 +
 Tests/SparkConnectTests/Resources/queries/geometry.sql.answer  | 5 +++++
 Tests/SparkConnectTests/SQLTests.swift                         | 4 +++-
 6 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build_and_test.yml 
b/.github/workflows/build_and_test.yml
index d8b4551..0d3e283 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -117,6 +117,7 @@ jobs:
         docker run -d --name spark -p 15003:15002 -e SPARK_NO_DAEMONIZE=1 \
           --entrypoint /opt/spark/sbin/start-connect-server.sh \
           apache/spark:4.2.0-preview5-scala \
+          -c spark.sql.geospatial.enabled=true \
           -c spark.sql.timeType.enabled=true
     - name: Test
       run: |
@@ -161,7 +162,7 @@ jobs:
         tar xvfz spark-4.2.0-preview5-bin-hadoop3.tgz && rm 
spark-4.2.0-preview5-bin-hadoop3.tgz
         mv spark-4.2.0-preview5-bin-hadoop3/ /tmp/spark
         cd /tmp/spark/sbin
-        ./start-connect-server.sh -c spark.sql.timeType.enabled=true
+        ./start-connect-server.sh -c spark.sql.geospatial.enabled=true -c 
spark.sql.timeType.enabled=true
         cd -
         swift test --no-parallel -c release
 
diff --git a/Tests/SparkConnectTests/Resources/queries/geography.sql 
b/Tests/SparkConnectTests/Resources/queries/geography.sql
new file mode 100644
index 0000000..db266f0
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/geography.sql
@@ -0,0 +1 @@
+SELECT 
hex(ST_AsBinary(ST_GeogFromWKB(X'0101000000000000000000F03F0000000000000040')))
diff --git a/Tests/SparkConnectTests/Resources/queries/geography.sql.answer 
b/Tests/SparkConnectTests/Resources/queries/geography.sql.answer
new file mode 100644
index 0000000..872e3d9
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/geography.sql.answer
@@ -0,0 +1,5 @@
++-------------------------------------------------------------------------------+
+|hex(st_asbinary(st_geogfromwkb(X'0101000000000000000000F03F0000000000000040')))|
++-------------------------------------------------------------------------------+
+|                                     
0101000000000000000000F03F0000000000000040|
++-------------------------------------------------------------------------------+
\ No newline at end of file
diff --git a/Tests/SparkConnectTests/Resources/queries/geometry.sql 
b/Tests/SparkConnectTests/Resources/queries/geometry.sql
new file mode 100644
index 0000000..83702d6
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/geometry.sql
@@ -0,0 +1 @@
+SELECT 
hex(ST_AsBinary(ST_GeomFromWKB(X'0101000000000000000000F03F0000000000000040')))
diff --git a/Tests/SparkConnectTests/Resources/queries/geometry.sql.answer 
b/Tests/SparkConnectTests/Resources/queries/geometry.sql.answer
new file mode 100644
index 0000000..b9d25d2
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/geometry.sql.answer
@@ -0,0 +1,5 @@
++----------------------------------------------------------------------------------+
+|hex(st_asbinary(st_geomfromwkb(X'0101000000000000000000F03F0000000000000040', 
0)))|
++----------------------------------------------------------------------------------+
+|                                        
0101000000000000000000F03F0000000000000040|
++----------------------------------------------------------------------------------+
\ No newline at end of file
diff --git a/Tests/SparkConnectTests/SQLTests.swift 
b/Tests/SparkConnectTests/SQLTests.swift
index 27adb21..9db802a 100644
--- a/Tests/SparkConnectTests/SQLTests.swift
+++ b/Tests/SparkConnectTests/SQLTests.swift
@@ -101,7 +101,9 @@ struct SQLTests {
   ]
 
   let queriesForSpark42Only: [String] = [
-    "time.sql"
+    "geography.sql",
+    "geometry.sql",
+    "time.sql",
   ]
 
   @Test


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

Reply via email to