Nisarg0007 commented on issue #14738:
URL: https://github.com/apache/datafusion/issues/14738#issuecomment-5601115824
I'd like to work on this. I reproduced the issue on v55.0.0:
```sql
SELECT date_part(
'microsecond',
timestamp '1970-01-01T00:40:00'
- timestamp '1970-01-01T00:00:00'
);
```
This currently panics in debug builds at `date_part.rs:426` with `attempt to
multiply with overflow`; release builds silently wrap and return an incorrect
value.
I also confirmed that the interval-semantics portion of this issue was fixed
by #14817, so I intend to target only the remaining `Duration` path.
My current plan is to perform the subsecond calculation using `i64`
internally while preserving the existing `Int32` return type. For values
outside the `Int32` range, should this return an error or saturate/clamp?
@alamb — you previously suggested the duration-part work might belong in
arrow-rs. My proposed change is limited to fixing the existing `i32` arithmetic
in DataFusion's `date_part.rs` rather than introducing an upstream kernel.
Would a local fix be appropriate here?
If this approach sounds good, I'd be happy to take this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]