Skip to content

Date + interval returns a type inconsistent with other databases #19527

@Omega359

Description

@Omega359

Describe the bug

As uncovered in #19460, SELECT '2001-09-28'::date + interval '1 hour' returns a Date32 or Date64 type depending on the lhs type whereas other systems return a timestamp:

Datafusion should adhere to common conventions for operation types unless there is a really good reason to deviate.

IOW, this should work:

query T
SELECT arrow_typeof('2001-09-28'::date + interval '1 hour')
----
Timestamp(ns)

To Reproduce

See above sql.

Expected behavior

date + type should return Timestamp, not date.

Additional context

No response

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