You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2025/03/17 19:27:26 UTC
(spark-connect-swift) branch main updated: [SPARK-51521] Add `integral/floating/string/date` type test and answer files
This is an automated email from the ASF dual-hosted git repository.
dongjoon 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 5511c4b [SPARK-51521] Add `integral/floating/string/date` type test and answer files
5511c4b is described below
commit 5511c4b922fb91e2a03700a070f658b580554c9b
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Mon Mar 17 12:27:19 2025 -0700
[SPARK-51521] Add `integral/floating/string/date` type test and answer files
### What changes were proposed in this pull request?
This PR aims to add `integral/floating/string/date` type test and answer files.
### Why are the changes needed?
To provide a test coverage for these types. During testings, it turns out `decimal` and `timestamp` type has some issues. It will be added.
### Does this PR introduce _any_ user-facing change?
No, this is a test-only change.
### How was this patch tested?
Pass the CIs and manual tests.
```
$ swift test --filter SQLTests
...
Suite SQLTests started.
Test runAll() started.
date.sql
floating.sql
integral.sql
pipesyntax.sql
select.sql
string.sql
Test runAll() passed after 0.191 seconds.
Suite SQLTests passed after 0.191 seconds.
Test run with 1 test passed after 0.191 seconds.
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #19 from dongjoon-hyun/SPARK-51521.
Authored-by: Dongjoon Hyun <do...@apache.org>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
Tests/SparkConnectTests/Resources/queries/date.sql | 1 +
Tests/SparkConnectTests/Resources/queries/date.sql.json | 1 +
Tests/SparkConnectTests/Resources/queries/floating.sql | 5 +++++
Tests/SparkConnectTests/Resources/queries/floating.sql.json | 1 +
Tests/SparkConnectTests/Resources/queries/integral.sql | 5 +++++
Tests/SparkConnectTests/Resources/queries/integral.sql.json | 1 +
Tests/SparkConnectTests/Resources/queries/string.sql | 1 +
Tests/SparkConnectTests/Resources/queries/string.sql.json | 1 +
8 files changed, 16 insertions(+)
diff --git a/Tests/SparkConnectTests/Resources/queries/date.sql b/Tests/SparkConnectTests/Resources/queries/date.sql
new file mode 100644
index 0000000..ec212b0
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/date.sql
@@ -0,0 +1 @@
+SELECT DATE '2025-03-15'
diff --git a/Tests/SparkConnectTests/Resources/queries/date.sql.json b/Tests/SparkConnectTests/Resources/queries/date.sql.json
new file mode 100644
index 0000000..3fda858
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/date.sql.json
@@ -0,0 +1 @@
+[["2025-03-15 00:00:00 +0000"]]
diff --git a/Tests/SparkConnectTests/Resources/queries/floating.sql b/Tests/SparkConnectTests/Resources/queries/floating.sql
new file mode 100644
index 0000000..6bbc412
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/floating.sql
@@ -0,0 +1,5 @@
+SELECT
+1.0F, -2.0F,
+3.0D, -4.0D,
+float('inf'), float('NaN'),
+double('inf'), double('NaN')
diff --git a/Tests/SparkConnectTests/Resources/queries/floating.sql.json b/Tests/SparkConnectTests/Resources/queries/floating.sql.json
new file mode 100644
index 0000000..8bedf9a
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/floating.sql.json
@@ -0,0 +1 @@
+[["1.0","-2.0","3.0","-4.0","inf","nan","inf","nan"]]
diff --git a/Tests/SparkConnectTests/Resources/queries/integral.sql b/Tests/SparkConnectTests/Resources/queries/integral.sql
new file mode 100644
index 0000000..d6b2474
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/integral.sql
@@ -0,0 +1,5 @@
+SELECT
+127Y, -128Y,
+32767S, -32768S,
+2147483647, -2147483648,
+9223372036854775807L, -9223372036854775808L
diff --git a/Tests/SparkConnectTests/Resources/queries/integral.sql.json b/Tests/SparkConnectTests/Resources/queries/integral.sql.json
new file mode 100644
index 0000000..4c24e38
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/integral.sql.json
@@ -0,0 +1 @@
+[["127","-128","32767","-32768","2147483647","-2147483648","9223372036854775807","-9223372036854775808"]]
diff --git a/Tests/SparkConnectTests/Resources/queries/string.sql b/Tests/SparkConnectTests/Resources/queries/string.sql
new file mode 100644
index 0000000..c569f85
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/string.sql
@@ -0,0 +1 @@
+SELECT 'abc', 'def'
diff --git a/Tests/SparkConnectTests/Resources/queries/string.sql.json b/Tests/SparkConnectTests/Resources/queries/string.sql.json
new file mode 100644
index 0000000..f5935b2
--- /dev/null
+++ b/Tests/SparkConnectTests/Resources/queries/string.sql.json
@@ -0,0 +1 @@
+[["abc","def"]]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org