mbutrovich commented on code in PR #7658:
URL: https://github.com/apache/datafusion-comet/pull/7658#discussion_r4634236487
##########
native/spark-expr/src/math_funcs/internal/checkoverflow.rs:
##########
@@ -249,6 +248,38 @@ impl PhysicalExpr for CheckOverflow {
}
}
+/// Values per chunk in the no-null scan of [`fits_precision`].
+const FITS_PRECISION_CHUNK: usize = 64;
+
+/// Whether every non-null value of `array` fits `precision`, the check that
+/// `Decimal128Type::is_valid_decimal_precision` makes for one value.
+#[inline]
+fn fits_precision(array: &Decimal128Array, precision: u8) -> bool {
Review Comment:
> Could you file the arrow-rs issue now and link it from a comment on
`fits_precision`?
apache/arrow-rs#12342 adds `#[inline]` to `is_valid_decimal_precision` and
changes the arrow-cast kernels, but it doesn't touch this scan.
[`PrimitiveArray::validate_decimal_precision`](https://github.com/apache/arrow-rs/blob/31ac909a640aad8a4e62f59e8a3607461597388d/arrow-array/src/array/primitive_array.rs#L1708-L1723)
on arrow-rs `main` still calls `is_valid` on every slot and returns at the
first error. Could you file the issue for porting `fits_precision` there, and
add a comment on
[`fits_precision`](https://github.com/apache/datafusion-comet/blob/5f164b99ba86d5a9685ed9e9219e4995605a36b4/native/spark-expr/src/math_funcs/internal/checkoverflow.rs#L251-L254)
that links it?
--
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]