jayzhan211 commented on code in PR #9503:
URL: https://github.com/apache/arrow-datafusion/pull/9503#discussion_r1517711410
##########
datafusion/functions-array/src/kernels.rs:
##########
@@ -306,9 +306,15 @@ pub(super) fn gen_range(args: &[ArrayRef], include_upper:
bool) -> Result<ArrayR
);
}
// Below, we utilize `usize` to represent steps.
- // But on 32-bit targets, the absolute value of `i64` may fail to fit
into `usize`.
+ #[cfg(target_pointer_width = "64")]
+ let step_abs = step.unsigned_abs() as usize;
+ // On 32-bit targets, the absolute value of `i64` may fail to fit into
`usize`.
+ #[cfg(not(target_pointer_width = "64"))]
let step_abs = usize::try_from(step.unsigned_abs()).map_err(|_| {
Review Comment:
If we are running in 32 bit target machine, are we able to reach the code
here and get step with i64? 🤔
##########
datafusion/functions-array/src/kernels.rs:
##########
@@ -306,9 +306,15 @@ pub(super) fn gen_range(args: &[ArrayRef], include_upper:
bool) -> Result<ArrayR
);
}
// Below, we utilize `usize` to represent steps.
- // But on 32-bit targets, the absolute value of `i64` may fail to fit
into `usize`.
+ #[cfg(target_pointer_width = "64")]
+ let step_abs = step.unsigned_abs() as usize;
+ // On 32-bit targets, the absolute value of `i64` may fail to fit into
`usize`.
+ #[cfg(not(target_pointer_width = "64"))]
let step_abs = usize::try_from(step.unsigned_abs()).map_err(|_| {
Review Comment:
If we are running in 32-bit target machine, are we able to reach the code
here and get the `step` with i64? 🤔
--
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]