You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/28 15:37:51 UTC

[GitHub] [arrow] wesm opened a new pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

wesm opened a new pull request #7568:
URL: https://github.com/apache/arrow/pull/7568


   Also updates the generated Flatbuffers bindings. 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] wesm commented on a change in pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

Posted by GitBox <gi...@apache.org>.
wesm commented on a change in pull request #7568:
URL: https://github.com/apache/arrow/pull/7568#discussion_r446993778



##########
File path: cpp/src/arrow/ipc/metadata_internal.cc
##########
@@ -257,6 +259,9 @@ Status ConcreteTypeFromFlatbuffer(flatbuf::Type type, const void* type_data,
       return Status::OK();
     case flatbuf::Type::Decimal: {
       auto dec_type = static_cast<const flatbuf::Decimal*>(type_data);
+      if (dec_type->bitWidth() != kDecimalBitWidth) {
+        return Status::Invalid("Library only supports 128-bit decimal values");

Review comment:
       The Flatbuffers library takes care of this -- `bitWidth()` always returns a value and if the serialized field is not present, the default 128 is returned. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7568:
URL: https://github.com/apache/arrow/pull/7568#issuecomment-650783849


   https://issues.apache.org/jira/browse/ARROW-9241


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] wesm closed pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

Posted by GitBox <gi...@apache.org>.
wesm closed pull request #7568:
URL: https://github.com/apache/arrow/pull/7568


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] wesm commented on pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

Posted by GitBox <gi...@apache.org>.
wesm commented on pull request #7568:
URL: https://github.com/apache/arrow/pull/7568#issuecomment-651142403


   +1


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] tianchen92 commented on a change in pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

Posted by GitBox <gi...@apache.org>.
tianchen92 commented on a change in pull request #7568:
URL: https://github.com/apache/arrow/pull/7568#discussion_r446812811



##########
File path: cpp/src/arrow/ipc/metadata_internal.cc
##########
@@ -257,6 +259,9 @@ Status ConcreteTypeFromFlatbuffer(flatbuf::Type type, const void* type_data,
       return Status::OK();
     case flatbuf::Type::Decimal: {
       auto dec_type = static_cast<const flatbuf::Decimal*>(type_data);
+      if (dec_type->bitWidth() != kDecimalBitWidth) {
+        return Status::Invalid("Library only supports 128-bit decimal values");

Review comment:
       sorry, bitWidth should return 128 if no value is set. LGTM

##########
File path: cpp/src/arrow/ipc/metadata_internal.cc
##########
@@ -257,6 +259,9 @@ Status ConcreteTypeFromFlatbuffer(flatbuf::Type type, const void* type_data,
       return Status::OK();
     case flatbuf::Type::Decimal: {
       auto dec_type = static_cast<const flatbuf::Decimal*>(type_data);
+      if (dec_type->bitWidth() != kDecimalBitWidth) {
+        return Status::Invalid("Library only supports 128-bit decimal values");

Review comment:
       should also handle the case when bitWidth == null?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] wesm commented on a change in pull request #7568: ARROW-9241: [C++] Add forward compatibility check for Decimal bit width

Posted by GitBox <gi...@apache.org>.
wesm commented on a change in pull request #7568:
URL: https://github.com/apache/arrow/pull/7568#discussion_r446994593



##########
File path: cpp/src/arrow/ipc/metadata_internal.cc
##########
@@ -257,6 +259,9 @@ Status ConcreteTypeFromFlatbuffer(flatbuf::Type type, const void* type_data,
       return Status::OK();
     case flatbuf::Type::Decimal: {
       auto dec_type = static_cast<const flatbuf::Decimal*>(type_data);
+      if (dec_type->bitWidth() != kDecimalBitWidth) {
+        return Status::Invalid("Library only supports 128-bit decimal values");

Review comment:
       Here's the generated binding -- so if `VT_BITWIDTH` is not present in the table then it returns 128
   
   ```c++
     int32_t bitWidth() const {
       return GetField<int32_t>(VT_BITWIDTH, 128);
     }
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org