16 #ifndef IMPALA_RUNTIME_TUPLE_H
17 #define IMPALA_RUNTIME_TUPLE_H
21 #include "gutil/macros.h"
28 class TupleDescriptor;
52 if (size == 0)
return NULL;
74 bool convert_ptrs =
false);
84 bool convert_ptrs =
false);
92 template <
bool collect_
string_vals>
95 const std::vector<ExprContext*>& materialize_expr_ctxs,
MemPool*
pool,
96 std::vector<StringValue*>* non_null_var_len_values = NULL,
97 int* total_var_len = NULL);
102 char* null_indicator_byte =
reinterpret_cast<char*
>(
this) + offset.
byte_offset;
103 *null_indicator_byte |= offset.
bit_mask;
108 char* null_indicator_byte =
reinterpret_cast<char*
>(
this) + offset.
byte_offset;
109 *null_indicator_byte &= ~offset.
bit_mask;
113 const char* null_indicator_byte =
114 reinterpret_cast<const char*
>(
this) + offset.
byte_offset;
115 return (*null_indicator_byte & offset.
bit_mask) != 0;
119 DCHECK(offset != -1);
120 return reinterpret_cast<char*
>(
this) + offset;
124 DCHECK(offset != -1);
125 return reinterpret_cast<const char*
>(
this) + offset;
129 DCHECK(offset != -1);
130 return reinterpret_cast<StringValue*
>(
reinterpret_cast<char*
>(
this) + offset);
const void * GetSlot(int offset) const
void SetNull(const NullIndicatorOffset &offset)
A tuple with 0 materialised slots is represented as NULL.
DISALLOW_COPY_AND_ASSIGN(Tuple)
void * GetSlot(int offset)
static Tuple * Create(int size, MemPool *pool)
initialize individual tuple with data residing in mem pool
Tuple * DeepCopy(const TupleDescriptor &desc, MemPool *pool, bool convert_ptrs=false)
bool IsNull(const NullIndicatorOffset &offset) const
static const char * LLVM_CLASS_NAME
For C++/IR interop, we need to be able to look up types by name.
StringValue * GetStringSlot(int offset)
uint8_t offset[7 *64-sizeof(uint64_t)]
void MaterializeExprs(TupleRow *row, const TupleDescriptor &desc, const std::vector< ExprContext * > &materialize_expr_ctxs, MemPool *pool, std::vector< StringValue * > *non_null_var_len_values=NULL, int *total_var_len=NULL)
uint8_t * Allocate(int size)
void SetNotNull(const NullIndicatorOffset &offset)
Turn null indicator bit off.