Skip to content

CI is failing on main / current_date() = cast(now() as date); #18062

Closed

Description

@alamb

Describe the bug

An example failure:
https://github.com/apache/datafusion/actions/runs/18508018377/job/52742095719


running 1 test
test engines::conversion::tests::test_big_decimal_to_str ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running bin/sqllogictests.rs (target/ci/deps/sqllogictests-8bd1cd21eda5b184)
External error: 1 errors in file /__w/datafusion/datafusion/datafusion/sqllogictest/test_files/current_date_timezone.slt

1. query result mismatch:
[SQL] SELECT current_date() = cast(now() as date);
[Diff] (-expected|+actual)
-   true
+   false
at /__w/datafusion/datafusion/datafusion/sqllogictest/test_files/current_date_timezone.slt:44



Error: Execution("1 failures\n\nbacktrace:    0: sqllogictests::run_tests::{{closure}}\n   1: tokio::runtime::park::CachedParkThread::block_on::{{closure}}\n   2: tokio::runtime::park::CachedParkThread::block_on\n   3: tokio::runtime::context::blocking::BlockingRegionGuard::block_on\n   4: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}\n   5: tokio::runtime::context::runtime::enter_runtime\n   6: tokio::runtime::scheduler::multi_thread::MultiThread::block_on\n   7: tokio::runtime::runtime::Runtime::block_on_inner\n   8: tokio::runtime::runtime::Runtime::block_on\n   9: sqllogictests::main\n  10: core::ops::function::FnOnce::call_once\n  11: std::sys::backtrace::__rust_begin_short_backtrace\n  12: std::rt::lang_start::{{closure}}\n  13: std::rt::lang_start_internal\n  14: std::rt::lang_start\n  15: main\n  16: <unknown>\n  17: __libc_start_main\n  18: _start\n")
error: test failed, to rerun pass `-p datafusion-sqllogictest --test sqllogictests`

To Reproduce

No response

Expected behavior

I expect CI to be clean

Additional context

Image

The test was introduced (but passed) in:

It first started failing in the next commit

So I am somewhat confused

Activity

  1. added theissue type on Oct 14, 2025
  2. changed the title [-]CI is failing on main[/-] [+]CI is failing on main / `current_date() = cast(now() as date);`[/+] on Oct 14, 2025
  3. dqkqd commented on Oct 14, 2025

    @dqkqd
    Contributor

    I run datafusion-cli on main.

    current_date returns expected behavior as introduced in the PR. It changes based on timezone.

    > SET datafusion.execution.time_zone = '+00:00';
    0 row(s) fetched.
    Elapsed 0.001 seconds.
    
    > select current_date();
    +----------------+
    | current_date() |
    +----------------+
    | 2025-10-14     |
    +----------------+
    1 row(s) fetched.
    Elapsed 0.004 seconds.
    
    > SET datafusion.execution.time_zone = '+05:00';
    0 row(s) fetched.
    Elapsed 0.001 seconds.
    
    > select current_date();
    +----------------+
    | current_date() |
    +----------------+
    | 2025-10-15     |
    +----------------+
    1 row(s) fetched.
    Elapsed 0.004 seconds.
    

    But now doesn't.

    DataFusion CLI v50.2.0
    > SET datafusion.execution.time_zone = '+00:00';
    0 row(s) fetched.
    Elapsed 0.003 seconds.
    
    > select now();
    +--------------------------------+
    | now()                          |
    +--------------------------------+
    | 2025-10-14T21:16:57.781868096Z |
    +--------------------------------+
    1 row(s) fetched.
    Elapsed 0.005 seconds.
    
    > SET datafusion.execution.time_zone = '+05:00';
    0 row(s) fetched.
    Elapsed 0.001 seconds.
    
    > select now();
    +--------------------------------+
    | now()                          |
    +--------------------------------+
    | 2025-10-14T21:17:02.014016475Z |
    +--------------------------------+
    1 row(s) fetched.
    Elapsed 0.003 seconds.
    
    >
    

    Might require #17993 to make the test work.

    The ci passed 3 hour ago, which was 18:00 UTC, so +00:00, +05:00 returns the same current date.

  4. comphead commented on Oct 14, 2025

    @comphead
    Contributor

    @dqkqd can we comment out test until you get the permanent fix with time merged?

  5. dqkqd commented on Oct 14, 2025

    @dqkqd
    Contributor

    @comphead
    Yeah I think we can comment the test.
    I found that @Weijun-H is working on now in #18017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions