alamb commented on a change in pull request #845:
URL: https://github.com/apache/arrow-rs/pull/845#discussion_r734418239
##########
File path: arrow/src/compute/kernels/cast.rs
##########
@@ -2340,35 +2340,41 @@ mod tests {
let f64_array: ArrayRef = Arc::new(Float64Array::from(f64_values));
let f64_expected = vec![
- "-9223372036854776000.0",
- "-2147483648.0",
- "-32768.0",
- "-128.0",
- "0.0",
- "255.0",
- "65535.0",
- "4294967295.0",
- "18446744073709552000.0",
+ -9223372036854776000.0,
+ -2147483648.0,
+ -32768.0,
+ -128.0,
+ 0.0,
+ 255.0,
+ 65535.0,
+ 4294967295.0,
+ 18446744073709552000.0,
];
assert_eq!(
f64_expected,
get_cast_values::<Float64Type>(&f64_array, &DataType::Float64)
Review comment:
Rather than casting f64 to f64, converting it to strings
(`get_cast_values`), and then reparsing, I wonder if it would be less error
prone to just do the cast to F64Array directly?
--
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]