tustvold commented on code in PR #2551:
URL: https://github.com/apache/arrow-rs/pull/2551#discussion_r952392319
##########
arrow/src/compute/kernels/take.rs:
##########
@@ -532,10 +532,15 @@ where
let t: Result<Option<_>> = t.map(|t| t.flatten());
t
})
- .collect::<Result<Decimal128Array>>()?
- // PERF: we could avoid re-validating that the data in
- // Decimal128Array was in range as we know it came from a valid
Decimal128Array
- .with_precision_and_scale(decimal_values.precision(),
decimal_values.scale())
+ .collect::<Result<Decimal128Array>>()?;
+
+ // specify the precision/scale without the validation
+ unsafe {
+ array.with_precision_and_scale_without_validation(
Review Comment:
There is something extremely bizarre about this API, we are collecting into
a `Decimal128Array` which to be consistent should be performing validation
based on the default decimal precision/scale, and we are then converting it
into a different array. I can't help feeling we should be consistently either
validating or not validating, at the moment we are basically doing a random
combination
--
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]