Jefffrey commented on code in PR #22823:
URL: https://github.com/apache/datafusion/pull/22823#discussion_r3451834628
##########
datafusion/functions/src/datetime/date_bin.rs:
##########
@@ -756,11 +765,11 @@ fn date_bin_impl(
}
let array = array.as_primitive::<Time64NanosecondType>();
let result: PrimitiveArray<Time64NanosecondType> =
- array.unary_opt(|x| {
+ array.try_unary(|x| {
stride_fn(stride, x, origin)
.map(|binned_nanos| binned_nanos %
(NANOSECONDS_IN_DAY))
- .ok()
- });
+ .map_err(|e|
ArrowError::ComputeError(e.to_string()))
Review Comment:
Are we meant to be surfacing an error on this path now?
##########
datafusion/functions/src/datetime/date_bin.rs:
##########
@@ -570,7 +572,7 @@ fn date_bin_impl(
) -> Option<i64> {
let scale = timestamp_scale::<T>();
value
- .and_then(|val| val.checked_mul(scale))
+ .and_then(|value| checked_scale_to_nanos(value, scale).ok())
Review Comment:
I still don't see the value add for this refactor
--
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]