Skip to content

PostgreSQL compatibility: time + interval should wrap within the 24-hour time domain #22265

Closed

Description

@Dandandan

Split out from #22247.

Mismatch

time + interval should wrap within the 24-hour time domain.

SELECT time '23:30' + interval '2 hours';

PostgreSQL:

01:30:00

DataFusion:

25 hours 30 mins

Expected behavior

For PostgreSQL-compatible SQL semantics, DataFusion should either match PostgreSQL's result or raise the same class of domain/semantic error.

Activity

  1. tarekakrout2021 commented on May 16, 2026

    @tarekakrout2021

    take

  2. tarekakrout2021 commented on May 16, 2026

    @tarekakrout2021

    untake

  3. kumarUjjawal commented on May 18, 2026

    @kumarUjjawal
    Contributor
    memory D SELECT time '23:30' + interval '2 hours';
    ┌───────────────────────────────────────────────────────┐
    │ (CAST('23:30' AS TIME) + CAST('2 hours' AS INTERVAL)) │
    │                         time                          │
    ├───────────────────────────────────────────────────────┤
    │ 01:30:00                                              │
    └───────────────────────────────────────────────────────┘
    
  4. vismaytiwari commented on Jul 1, 2026

    @vismaytiwari
    Contributor

    Opened #23279 for this. time + interval now returns a wrapped time (23:30 + 2h → 01:30) instead of an interval, following the existing Date - Date handling. Open to feedback.

  5. added a commit that references this issue on Jul 1, 2026
    5b6be8b
  6. added a commit that references this issue on Jul 17, 2026
    1e58928
  7. added a commit that references this issue on Aug 12, 2026
    85ecd70
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 workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions