22 using namespace impala;
35 int slots_per_tuple,
int row_idx_start) {
38 uint8_t* tuple_row_mem =
reinterpret_cast<uint8_t*
>(tuple_row);
39 uint8_t* tuple_mem =
reinterpret_cast<uint8_t*
>(
tuple_);
40 Tuple* tuple =
reinterpret_cast<Tuple*
>(tuple_mem);
42 uint8_t error[slots_per_tuple];
43 memset(error, 0,
sizeof(error));
45 int tuples_returned = 0;
48 for (
int i = 0; i < num_tuples; ++i) {
49 uint8_t error_in_row =
false;
53 error, &error_in_row)) {
56 tuple_row_mem += row_size;
57 tuple =
reinterpret_cast<Tuple*
>(tuple_mem);
58 tuple_row =
reinterpret_cast<TupleRow*
>(tuple_row_mem);
69 fields += slots_per_tuple;
71 if (tuples_returned == max_added_tuples) {
76 return tuples_returned;
91 return StringParser::StringToInt<int8_t>(s, len, result);
96 return StringParser::StringToInt<int16_t>(s, len, result);
101 return StringParser::StringToInt<int32_t>(s, len, result);
106 return StringParser::StringToInt<int64_t>(s, len, result);
111 return StringParser::StringToFloat<float>(s, len, result);
116 return StringParser::StringToFloat<double>(s, len, result);
120 bool IrIsNullString(
const char* data,
int len) {
121 return data == NULL || (len == 2 && data[0] ==
'\\' && data[1] ==
'N');
125 bool IrGenericIsNullString(
const char* s,
int slen,
const char* n,
int nlen) {
126 return s == NULL || (slen == nlen &&
StringCompare(s, slen, n, nlen, slen) == 0);
ExprContext * GetConjunctCtx(int idx) const
int tuple_byte_size_
Fixed size of each tuple, in bytes.
A tuple with 0 materialised slots is represented as NULL.
std::vector< ExprContext * > conjunct_ctxs_
static bool StringToBool(const char *s, int len, ParseResult *result)
Parses a string for 'true' or 'false', case insensitive.
bool WriteCompleteTuple(MemPool *pool, FieldLocation *fields, Tuple *tuple, TupleRow *tuple_row, Tuple *template_tuple, uint8_t *error_fields, uint8_t *error_in_row)
int WriteAlignedTuples(MemPool *pool, TupleRow *tuple_row_mem, int row_size, FieldLocation *fields, int num_tuples, int max_added_tuples, int slots_per_tuple, int row_start_indx)
Tuple * tuple_
Current tuple pointer into tuple_mem_.
static int StringCompare(const char *s1, int n1, const char *s2, int n2, int len)
bool ReportTupleParseError(FieldLocation *fields, uint8_t *errors, int row_idx)