andygrove opened a new issue, #5089:
URL: https://github.com/apache/datafusion-comet/issues/5089

   ### What is the problem the feature request solves?
   
   `is_valid_decimal_precision` in `native/spark-expr/src/utils.rs` is a 
character-for-character copy of arrow's implementation (verified against the 
vendored arrow-data 58.4.0 source). The function's own comment says it can be 
removed once arrow-rs includes https://github.com/apache/arrow-rs/pull/6419, 
and that PR shipped long before the arrow 58 we depend on.
   
   ### Describe the potential solution
   
   Delete the copy and use 
`arrow::datatypes::Decimal128Type::validate_decimal_precision(value, 
precision).is_ok()` (or the `is_valid_decimal_precision` trait method) at the 
call sites, which include `agg_funcs/sum_decimal.rs` and 
`agg_funcs/avg_decimal.rs`.
   
   ### Additional context
   
   No semantic risk: the implementations are identical, including the bounds 
tables. The `precision <= DECIMAL128_MAX_PRECISION` guard is subsumed by 
arrow's validation.
   
   Found during an audit of native code that replicates existing arrow-rs 
kernels.
   


-- 
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]

Reply via email to