You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
arrow_cast accepts invalid Time32(Microsecond)/Time32(Nanosecond)/Time64(Second)/Time64(Millisecond), panics on use #22194
arrow_cast accepts type strings that are not legal Arrow type combinations. The cast itself succeeds and the type propagates through the logical plan, but downstream operations panic in arrow-array with not implemented: Unexpected data type Time32(µs) (or similar).
Per the Arrow spec, Time32 only supports Second and Millisecond; Time64 only supports Microsecond and Nanosecond. The other four combinations should be rejected.
arrow_cast should reject the four invalid Time(Unit) combinations at planning time with a plan_err! such as:
Invalid Arrow type combination: Time32 only supports Second and Millisecond. Use Time64(Microsecond) for sub-millisecond precision.
The public SQL API should never panic on user-supplied SQL, even with obviously-malformed type strings.
Root cause
arrow_cast constructs a DataType::Time32(TimeUnit::Microsecond) (or similar invalid combo) from the user-supplied string without validating against Arrow's type-system rules. Downstream arrow-array code paths assume the type is well-formed and panic via unimplemented!() when they see the illegal combination.
Two-sided fix:
DataFusion: validate Time32/Time64 × TimeUnit combinations when parsing the target type in arrow_cast.
arrow-rs (separate): even if a malformed type reaches array code, it should return DataFusionError/ArrowError rather than unimplemented!().
Additional context
Found by a cargo fuzz target (fuzz/fuzz_targets/sql_physical_plan.rs) seeded with SQL from datafusion/sqllogictest/test_files/. The fuzzer mutated an existing arrow_cast(..., 'Time32(Second)') example by changing Second → Microsecond.
Activity
Jefffrey commentedon Jun 16, 2026
See upstream issue
DataTypeparsing arrow-rs#10146Jefffrey commentedon Jul 8, 2026