aboutsummaryrefslogtreecommitdiff
path: root/contrib/native/client/src/include
diff options
context:
space:
mode:
authorParth Chandra <pchandra@maprtech.com>2014-08-27 18:07:35 -0700
committerJacques Nadeau <jacques@apache.org>2014-08-27 18:36:30 -0700
commitcc25504d1bfeb7ac7bc99a6c3ce5285d30e13697 (patch)
treef100494543a6744bf360efb68e97e91a6910c918 /contrib/native/client/src/include
parentceb58c4149f00de4729ff7350b576823e71fbdfc (diff)
DRILL-1352: C++ Client. Update the decoding of nullable value vectors to read a byte for every nullable bit.
Diffstat (limited to 'contrib/native/client/src/include')
-rw-r--r--contrib/native/client/src/include/drill/common.hpp2
-rw-r--r--contrib/native/client/src/include/drill/protobuf/Types.pb.h5
-rw-r--r--contrib/native/client/src/include/drill/recordBatch.hpp10
3 files changed, 9 insertions, 8 deletions
diff --git a/contrib/native/client/src/include/drill/common.hpp b/contrib/native/client/src/include/drill/common.hpp
index dfb04e83f..151d698b5 100644
--- a/contrib/native/client/src/include/drill/common.hpp
+++ b/contrib/native/client/src/include/drill/common.hpp
@@ -33,7 +33,7 @@
#include <vector>
#include <boost/shared_ptr.hpp>
-#define DRILL_RPC_VERSION 1
+#define DRILL_RPC_VERSION 2
#define LENGTH_PREFIX_MAX_LENGTH 5
#define LEN_PREFIX_BUFLEN LENGTH_PREFIX_MAX_LENGTH
diff --git a/contrib/native/client/src/include/drill/protobuf/Types.pb.h b/contrib/native/client/src/include/drill/protobuf/Types.pb.h
index 853415317..b26177c44 100644
--- a/contrib/native/client/src/include/drill/protobuf/Types.pb.h
+++ b/contrib/native/client/src/include/drill/protobuf/Types.pb.h
@@ -72,11 +72,12 @@ enum MinorType {
DM_UNKNOWN = 37,
INTERVALYEAR = 38,
INTERVALDAY = 39,
- LIST = 40
+ LIST = 40,
+ GENERIC_OBJECT = 41
};
bool MinorType_IsValid(int value);
const MinorType MinorType_MIN = LATE;
-const MinorType MinorType_MAX = LIST;
+const MinorType MinorType_MAX = GENERIC_OBJECT;
const int MinorType_ARRAYSIZE = MinorType_MAX + 1;
const ::google::protobuf::EnumDescriptor* MinorType_descriptor();
diff --git a/contrib/native/client/src/include/drill/recordBatch.hpp b/contrib/native/client/src/include/drill/recordBatch.hpp
index 9a3df2b6f..61db88c8c 100644
--- a/contrib/native/client/src/include/drill/recordBatch.hpp
+++ b/contrib/native/client/src/include/drill/recordBatch.hpp
@@ -386,7 +386,7 @@ template <typename VALUE_TYPE>
{
public:
NullableValueVectorFixed(SlicedByteBuf *b, size_t rowCount):ValueVectorBase(b, rowCount){
- size_t offsetEnd = (size_t)ceil(rowCount/8.0);
+ size_t offsetEnd = (size_t)rowCount;
this->m_pBitmap= new SlicedByteBuf(*b, 0, offsetEnd);
this->m_pData= new SlicedByteBuf(*b, offsetEnd, b->getLength());
// TODO: testing boundary case(null columns)
@@ -399,7 +399,7 @@ template <typename VALUE_TYPE>
// test whether the value is null in the position index
bool isNull(size_t index) const {
- return (m_pBitmap->getBit(index)==0);
+ return (m_pBitmap->getByte(index)==0);
}
VALUE_TYPE get(size_t index) const {
@@ -584,14 +584,14 @@ template <class VALUEHOLDER_CLASS_TYPE, class VALUE_VECTOR_TYPE>
public:
NullableValueVectorTyped(SlicedByteBuf *b, size_t rowCount):ValueVectorBase(b, rowCount){
- size_t offsetEnd = (size_t)ceil(rowCount/8.0);
+ size_t offsetEnd = (size_t)rowCount;
this->m_pBitmap= new SlicedByteBuf(*b, 0, offsetEnd);
this->m_pData= new SlicedByteBuf(*b, offsetEnd, b->getLength()-offsetEnd);
this->m_pVector= new VALUE_VECTOR_TYPE(m_pData, rowCount);
}
// Specialized for Decimal Types
NullableValueVectorTyped(SlicedByteBuf *b, size_t rowCount, int32_t scale):ValueVectorBase(b, rowCount){
- size_t offsetEnd = (size_t)ceil(rowCount/8.0);
+ size_t offsetEnd = (size_t)rowCount;
this->m_pBitmap= new SlicedByteBuf(*b, 0, offsetEnd);
this->m_pData= new SlicedByteBuf(*b, offsetEnd, b->getLength()-offsetEnd);
this->m_pVector= new VALUE_VECTOR_TYPE(m_pData, rowCount, scale);
@@ -604,7 +604,7 @@ template <class VALUEHOLDER_CLASS_TYPE, class VALUE_VECTOR_TYPE>
}
bool isNull(size_t index) const{
- return (m_pBitmap->getBit(index)==0);
+ return (m_pBitmap->getByte(index)==0);
}
VALUEHOLDER_CLASS_TYPE get(size_t index) const {