You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/07/28 18:04:14 UTC
[I] Remove is_valid_decimal_precision duplicated from arrow-rs [datafusion-comet]
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Remove is_valid_decimal_precision duplicated from arrow-rs [datafusion-comet]
Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao closed issue #5089: Remove is_valid_decimal_precision duplicated from arrow-rs
URL: https://github.com/apache/datafusion-comet/issues/5089
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Remove is_valid_decimal_precision duplicated from arrow-rs [datafusion-comet]
Posted by "Smallfu666 (via GitHub)" <gi...@apache.org>.
Smallfu666 commented on issue #5089:
URL: https://github.com/apache/datafusion-comet/issues/5089#issuecomment-5138309775
take
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org