19 using namespace impala;
25 int num_to_commit = 0;
26 for (
int i = 0; i < max_tuples; ++i) {
40 DCHECK(null_union_position == 0 || null_union_position == 1);
41 int8_t union_position = **data;
43 DCHECK(union_position == 0 || union_position == 2);
45 if (union_position == 2) union_position = 1;
47 return union_position != null_union_position;
54 *
reinterpret_cast<bool*
>(slot) = *reinterpret_cast<bool*>(*data);
64 *
reinterpret_cast<int32_t*
>(slot) = val;
66 *
reinterpret_cast<int64_t*
>(slot) = val;
68 *
reinterpret_cast<float*
>(slot) = val;
70 *
reinterpret_cast<double*
>(slot) = val;
82 *
reinterpret_cast<int64_t*
>(slot) = val;
84 *
reinterpret_cast<float*
>(slot) = val;
86 *
reinterpret_cast<double*
>(slot) = val;
96 float val = *
reinterpret_cast<float*
>(*data);
98 *
reinterpret_cast<float*
>(slot) = val;
100 *
reinterpret_cast<double*
>(slot) = val;
112 *
reinterpret_cast<double*
>(slot) = *reinterpret_cast<double*>(*data);
123 int str_len = std::min(static_cast<int>(len), max_len);
124 DCHECK(str_len >= 0);
126 sv->
ptr =
reinterpret_cast<char*
>(*data);
137 int str_len = std::min(static_cast<int>(len), max_len);
140 sv->
ptr =
reinterpret_cast<char*
>(pool->
Allocate(max_len));
142 memcpy(sv->
ptr, *data, str_len);
145 memcpy(slot, *data, str_len);
159 sv->
ptr =
reinterpret_cast<char*
>(*data);
171 DCHECK_LE(len, slot_byte_size);
172 int bytes_to_fill = slot_byte_size - len;
173 #if __BYTE_ORDER == __LITTLE_ENDIAN
176 memcpy(slot, *data, len);
178 switch (slot_byte_size) {
180 int32_t* decimal =
reinterpret_cast<int32_t*
>(slot);
181 *decimal >>= bytes_to_fill * 8;
185 int64_t* decimal =
reinterpret_cast<int64_t*
>(slot);
186 *decimal >>= bytes_to_fill * 8;
191 *decimal >>= bytes_to_fill * 8;
195 DCHECK(
false) <<
"Decimal slots can't be this size: " << slot_byte_size;
void ReadAvroVarchar(PrimitiveType type, int max_len, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
HdfsScanNode * scan_node_
The scan node that started this scanner.
A tuple with 0 materialised slots is represented as NULL.
void ReadAvroBoolean(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
static void PadWithSpaces(char *cptr, int64_t cptr_len, int64_t num_chars)
TupleRow * next_row(TupleRow *r) const
static int64_t ByteSwap(int64_t value)
Swaps the byte order (i.e. endianess)
void ReadAvroDecimal(int slot_byte_size, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
void MaterializeTuple(MemPool *pool, uint8_t **data, Tuple *tuple)
Materializes a single tuple from serialized record data.
void InitTuple(Tuple *template_tuple, Tuple *tuple)
static int64_t ReadZLong(uint8_t **buf)
void ReadAvroDouble(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
static ColumnType CreateCharType(int len)
int DecodeAvroData(int max_tuples, MemPool *pool, uint8_t **data, Tuple *tuple, TupleRow *tuple_row)
static int32_t ReadZInt(uint8_t **buf)
Read a zig-zag encoded int.
void ReadAvroChar(PrimitiveType type, int max_len, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
bool IR_ALWAYS_INLINE EvalConjuncts(TupleRow *row)
void SetTuple(int tuple_idx, Tuple *tuple)
void ReadAvroFloat(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
void ReadAvroInt64(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
void ReadAvroInt32(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
void ReadAvroString(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
uint8_t * Allocate(int size)
Tuple * next_tuple(Tuple *t) const
__int128_t int128_t
We use the c++ int128_t type. This is stored using 16 bytes and very performant.
bool ReadUnionType(int null_union_position, uint8_t **data)