Skip to content

Commit 431ff5a

Browse files
Subham SinghalSubham Singhal
authored andcommitted
Fix interval type test cases
1 parent 67c4b40 commit 431ff5a

1 file changed

Lines changed: 6 additions & 30 deletions

File tree

datafusion/sqllogictest/test_files/spark/math/negative.slt

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -169,30 +169,6 @@ SELECT negative(-1.5::double);
169169
----
170170
1.5
171171

172-
# Test negative with zero float (using table to avoid constant folding)
173-
statement ok
174-
CREATE TABLE zero_float_test AS VALUES (0.0::float);
175-
176-
query R
177-
SELECT negative(column1) FROM zero_float_test;
178-
----
179-
-0.0
180-
181-
statement ok
182-
DROP TABLE zero_float_test
183-
184-
# Test negative with negative zero float
185-
statement ok
186-
CREATE TABLE neg_zero_float_test AS VALUES (-0.0::float);
187-
188-
query R
189-
SELECT negative(column1) FROM neg_zero_float_test;
190-
----
191-
0.0
192-
193-
statement ok
194-
DROP TABLE neg_zero_float_test
195-
196172
# Test negative with decimal
197173
query R
198174
SELECT negative(123.456::decimal(10,3));
@@ -358,19 +334,19 @@ SELECT negative(-1.7976931348623157e308::double);
358334
query ?
359335
SELECT negative(make_interval(1, 2, 3, 4, 5, 6, 7.5));
360336
----
361-
0 years -14 mons -25 days -5 hours -6 mins -7.500 secs
337+
-14 mons -25 days -5 hours -6 mins -7.500000000 secs
362338

363339
# Test negative with negative CalendarIntervalType
364340
query ?
365341
SELECT negative(make_interval(-2, -5, -1, -10, -3, -30, -15.25));
366342
----
367-
0 years 29 mons 17 days 3 hours 30 mins 15.250 secs
343+
29 mons 17 days 3 hours 30 mins 15.250000000 secs
368344

369345
# Test negative with zero interval
370346
query ?
371347
SELECT negative(make_interval(0, 0, 0, 0, 0, 0, 0.0));
372348
----
373-
0 years 0 mons 0 days 0 hours 0 mins 0.00 secs
349+
(empty)
374350

375351
# Test negative with CalendarInterval from table
376352
statement ok
@@ -382,9 +358,9 @@ CREATE TABLE interval_test AS VALUES
382358
query ? rowsort
383359
SELECT negative(column1) FROM interval_test;
384360
----
385-
0 years -14 mons -5 days 0 hours 0 mins 0.00 secs
386-
0 years 0 mons 0 days 0 hours 0 mins 0.00 secs
387-
0 years 37 mons 2 days 0 hours 0 mins 0.00 secs
361+
-14 mons -5 days 0 hours 0 mins 0.00 secs
362+
(empty)
363+
37 mons 2 days 0 hours 0 mins 0.00 secs
388364

389365
statement ok
390366
DROP TABLE interval_test;

0 commit comments

Comments
 (0)