Skip to content

panic: date_bin overflows scaling extreme Time64(Microsecond) source #22212

@Dandandan

Description

@Dandandan

Describe the bug

date_bin panics during planning/constant folding when scaling an extreme Time64(Microsecond) source value.

To Reproduce

EXPLAIN SELECT date_bin(
  INTERVAL '1 microsecond',
  arrow_cast(9223372036854775807, 'Time64(Microsecond)'),
  arrow_cast(0, 'Time64(Microsecond)')
);

Actual behavior

thread 'main' panicked at datafusion/functions/src/datetime/date_bin.rs:669:56:
attempt to multiply with overflow

Expected behavior

Return a DataFusion error for the out-of-range time conversion, not a panic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions