arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jul...@apache.org
Subject arrow git commit: ARROW-253: restrict ints to 8, 16, 32, or 64 bits in V1
Date Fri, 12 Aug 2016 23:00:21 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 2742d37cc -> dc01f099d


ARROW-253: restrict ints to 8, 16, 32, or 64 bits in V1

Author: Julien Le Dem <julien@dremio.com>

Closes #115 from julienledem/arrow_253_int_8_16_32_64 and squashes the following commits:

d8df119 [Julien Le Dem] ARROW-253: restrict ints to 8, 16, 32, or 64 bits in V1


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/dc01f099
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/dc01f099
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/dc01f099

Branch: refs/heads/master
Commit: dc01f099d966b92f4de7679b4a1caf97c363e08e
Parents: 2742d37
Author: Julien Le Dem <julien@dremio.com>
Authored: Fri Aug 12 16:00:18 2016 -0700
Committer: Julien Le Dem <julien@dremio.com>
Committed: Fri Aug 12 16:00:18 2016 -0700

----------------------------------------------------------------------
 cpp/src/arrow/ipc/metadata-internal.cc | 9 ++++-----
 format/Message.fbs                     | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/dc01f099/cpp/src/arrow/ipc/metadata-internal.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/metadata-internal.cc b/cpp/src/arrow/ipc/metadata-internal.cc
index 5c43912..e6b47de 100644
--- a/cpp/src/arrow/ipc/metadata-internal.cc
+++ b/cpp/src/arrow/ipc/metadata-internal.cc
@@ -55,12 +55,12 @@ const std::shared_ptr<DataType> DOUBLE = std::make_shared<DoubleType>();
 
 static Status IntFromFlatbuffer(
     const flatbuf::Int* int_data, std::shared_ptr<DataType>* out) {
-  if (int_data->bitWidth() % 8 != 0) {
-    return Status::NotImplemented("Integers not in cstdint are not implemented");
-  }
   if (int_data->bitWidth() > 64) {
     return Status::NotImplemented("Integers with more than 64 bits not implemented");
   }
+  if (int_data->bitWidth() < 8) {
+    return Status::NotImplemented("Integers with less than 8 bits not implemented");
+  }
 
   switch (int_data->bitWidth()) {
     case 8:
@@ -76,8 +76,7 @@ static Status IntFromFlatbuffer(
       *out = int_data->is_signed() ? INT64 : UINT64;
       break;
     default:
-      *out = nullptr;
-      break;
+      return Status::NotImplemented("Integers not in cstdint are not implemented");
   }
   return Status::OK();
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/dc01f099/format/Message.fbs
----------------------------------------------------------------------
diff --git a/format/Message.fbs b/format/Message.fbs
index e0a956c..6a351b9 100644
--- a/format/Message.fbs
+++ b/format/Message.fbs
@@ -21,7 +21,7 @@ table Union {
 }
 
 table Int {
-  bitWidth: int; // 1 to 64
+  bitWidth: int; // restricted to 8, 16, 32, and 64 in v1
   is_signed: bool;
 }
 


Mime
View raw message