Skip to content

Commit 11920bb

Browse files
committed
[SPARK-52775] Add time SQL test and answer file
1 parent a7e7feb commit 11920bb

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT TIME '12:34:56.123456', to_time('12:34:56.123456'), make_time(12, 34, 56.123456)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
+----------------------+------------------------+----------------------------+
2+
|TIME '12:34:56.123456'|to_time(12:34:56.123456)|make_time(12, 34, 56.123456)|
3+
+----------------------+------------------------+----------------------------+
4+
| 12:34:56.123456| 12:34:56.123456| 12:34:56.123456|
5+
+----------------------+------------------------+----------------------------+

Tests/SparkConnectTests/SQLTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ struct SQLTests {
9999
"variant.sql",
100100
]
101101

102+
let queriesForSpark41Only: [String] = [
103+
"time.sql",
104+
]
105+
102106
#if !os(Linux)
103107
@Test
104108
func runAll() async throws {
@@ -111,6 +115,10 @@ struct SQLTests {
111115
print("Skip query \(name) due to the difference between Spark 3 and 4.")
112116
continue
113117
}
118+
if await !spark.version.starts(with: "4.1") && queriesForSpark41Only.contains(name) {
119+
print("Skip query \(name) due to the difference between Spark 4.0 and 4.1")
120+
continue
121+
}
114122

115123
let sql = try String(contentsOf: URL(fileURLWithPath: "\(path)/\(name)"), encoding: .utf8)
116124
let result =

0 commit comments

Comments
 (0)