You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is one issue found when I'm trying to enable generate_decimal128_case integration case for Rust at C++ repo: #13219.
Rust validates precision of decimal in few places, e.g. DecimalBuilder's append_value. However, in decimal golden file 0.14.1_decimal.gold.json, there are some values failing this check. C++ doesn't perform similar check in appending value at decimal builder as I did a search (e.g. Decimal128Builder, DecimalFromString), and I can confirm that test case can be passed if I remove the check in DecimalBuilder.append_value.
Actually in C++, similar check is done when doing a full validating ArrayData:
Status ValidateDecimals(const DecimalType& type) {
.
I'm wondering if we should follow C++ at Rust implementation, i.e. removing the check from appending value at decimal builder, and moving the check to the full validation of ArrayData?
Another opinion from the comments is, as we don't do full validation when finishing the decimal builder, it seems this check is necessary if it is the promise of the builder to always build a valid ArrayData. Then the check is needed and it seems C++ needs to add the check there.
David Li / @lidavidm:
I suppose in Rust parlance, the C++ builders are unsafe because they don't do the check. We could consider adding checked variants/adding an explicitly unchecked variant.
This is one issue found when I'm trying to enable generate_decimal128_case integration case for Rust at C++ repo: #13219.
Rust validates precision of decimal in few places, e.g. DecimalBuilder's append_value. However, in decimal golden file 0.14.1_decimal.gold.json, there are some values failing this check. C++ doesn't perform similar check in appending value at decimal builder as I did a search (e.g. Decimal128Builder, DecimalFromString), and I can confirm that test case can be passed if I remove the check in DecimalBuilder.append_value.
Actually in C++, similar check is done when doing a full validating ArrayData:
arrow/cpp/src/arrow/array/validate.cc
Line 672 in c715beb
I'm wondering if we should follow C++ at Rust implementation, i.e. removing the check from appending value at decimal builder, and moving the check to the full validation of ArrayData?
I opened a Rust PR (apache/arrow-rs#1767) for that.
Another opinion from the comments is, as we don't do full validation when finishing the decimal builder, it seems this check is necessary if it is the promise of the builder to always build a valid ArrayData. Then the check is needed and it seems C++ needs to add the check there.
Would like to hear some feedback here. Thanks.
Reporter: L. C. Hsieh
Related issues:
Note: This issue was originally created as ARROW-16696. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: