kou commented on code in PR #43957:
URL: https://github.com/apache/arrow/pull/43957#discussion_r1746083477
##########
cpp/src/arrow/integration/json_internal.cc:
##########
@@ -969,11 +1009,17 @@ Result<std::shared_ptr<DataType>> GetDecimal(const
RjObject& json_type) {
bit_width = maybe_bit_width.ValueOrDie();
}
- if (bit_width == 128) {
- return decimal128(precision, scale);
- } else if (bit_width == 256) {
- return decimal256(precision, scale);
+ switch (bit_width) {
+ case 32:
+ return decimal32(precision, scale);
+ case 64:
+ return decimal64(precision, scale);
+ case 128:
+ return decimal128(precision, scale);
+ case 256:
+ return decimal256(precision, scale);
}
+
return Status::Invalid("Only 128 bit and 256 Decimals are supported.
Received",
bit_width);
Review Comment:
Could you update this message too?
##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -1253,6 +1253,10 @@ struct SchemaImporter {
type_ = decimal128(prec_scale[0], prec_scale[1]);
} else if (prec_scale[2] == 256) {
type_ = decimal256(prec_scale[0], prec_scale[1]);
+ } else if (prec_scale[2] == 32) {
+ type_ = decimal32(prec_scale[0], prec_scale[1]);
+ } else if (prec_scale[2] == 64) {
+ type_ = decimal64(prec_scale[0], prec_scale[1]);
Review Comment:
Can we use 32 -> 64 -> 128 -> 256 order here?
--
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]