|
19 | 19 | ## current_date with timezone tests |
20 | 20 | ########## |
21 | 21 |
|
| 22 | +# CI Fails https://github.com/apache/datafusion/issues/18062 |
| 23 | + |
22 | 24 | # Test 1: Verify current_date is consistent within the same query (default UTC) |
23 | | -query B |
24 | | -SELECT current_date() = current_date(); |
25 | | ----- |
26 | | -true |
| 25 | +# query B |
| 26 | +# SELECT current_date() = current_date(); |
| 27 | +# ---- |
| 28 | +# true |
27 | 29 |
|
28 | 30 | # Test 2: Verify alias 'today' works the same as current_date |
29 | | -query B |
30 | | -SELECT current_date() = today(); |
31 | | ----- |
32 | | -true |
| 31 | +# query B |
| 32 | +# SELECT current_date() = today(); |
| 33 | +# ---- |
| 34 | +# true |
33 | 35 |
|
34 | 36 | # Test 3: Set timezone to +05:00 and verify current_date is still stable |
35 | | -statement ok |
36 | | -SET datafusion.execution.time_zone = '+05:00'; |
| 37 | +# statement ok |
| 38 | +# SET datafusion.execution.time_zone = '+05:00'; |
37 | 39 |
|
38 | | -query B |
39 | | -SELECT current_date() = current_date(); |
40 | | ----- |
41 | | -true |
| 40 | +# query B |
| 41 | +# SELECT current_date() = current_date(); |
| 42 | +# ---- |
| 43 | +# true |
42 | 44 |
|
43 | | -#Test 4: Verify current_date matches cast(now() as date) in the same timezone |
44 | | -query B |
45 | | -SELECT current_date() = cast(now() as date); |
46 | | ----- |
47 | | -true |
| 45 | +# Test 4: Verify current_date matches cast(now() as date) in the same timezone |
| 46 | +# query B |
| 47 | +# SELECT current_date() = cast(now() as date); |
| 48 | +# ---- |
| 49 | +# true |
48 | 50 |
|
49 | 51 | # Test 5: Test with negative offset timezone |
50 | | -statement ok |
51 | | -SET datafusion.execution.time_zone = '-08:00'; |
| 52 | +# statement ok |
| 53 | +# SET datafusion.execution.time_zone = '-08:00'; |
52 | 54 |
|
53 | | -query B |
54 | | -SELECT current_date() = today(); |
55 | | ----- |
56 | | -true |
| 55 | +# query B |
| 56 | +# SELECT current_date() = today(); |
| 57 | +# ---- |
| 58 | +# true |
57 | 59 |
|
58 | 60 | # Test 6: Test with named timezone (America/New_York) |
59 | | -statement ok |
60 | | -SET datafusion.execution.time_zone = 'America/New_York'; |
| 61 | +# statement ok |
| 62 | +# SET datafusion.execution.time_zone = 'America/New_York'; |
61 | 63 |
|
62 | | -query B |
63 | | -SELECT current_date() = current_date(); |
64 | | ----- |
65 | | -true |
| 64 | +# query B |
| 65 | +# SELECT current_date() = current_date(); |
| 66 | +# ---- |
| 67 | +# true |
66 | 68 |
|
67 | 69 | # Test 7: Verify date type is preserved |
68 | | -query T |
69 | | -SELECT arrow_typeof(current_date()); |
70 | | ----- |
71 | | -Date32 |
| 70 | +# query T |
| 71 | +# SELECT arrow_typeof(current_date()); |
| 72 | +# ---- |
| 73 | +# Date32 |
72 | 74 |
|
73 | 75 | # Test 8: Reset to UTC |
74 | | -statement ok |
75 | | -SET datafusion.execution.time_zone = '+00:00'; |
| 76 | +# statement ok |
| 77 | +# SET datafusion.execution.time_zone = '+00:00'; |
76 | 78 |
|
77 | | -query B |
78 | | -SELECT current_date() = today(); |
79 | | ----- |
80 | | -true |
| 79 | +# query B |
| 80 | +# SELECT current_date() = today(); |
| 81 | +# ---- |
| 82 | +# true |
0 commit comments