15 #ifndef IMPALA_UTIL_KEY_NORMALIZER_H_
16 #define IMPALA_UTIL_KEY_NORMALIZER_H_
56 KeyNormalizer(
const std::vector<ExprContext*>& key_exprs_ctxs,
int key_len,
57 const std::vector<bool>& is_asc,
const std::vector<bool>& nulls_first)
71 static bool WriteNullBit(uint8_t null_bit, uint8_t* value, uint8_t* dst,
77 template <
typename ValueType>
80 template <
typename IntType>
81 static void NormalizeInt(
void* src,
void* dst,
bool is_asc);
85 template <
typename FloatType,
typename ResultType>
93 uint8_t* value, uint8_t* dst,
int* bytes_left);
98 uint8_t* value, uint8_t* dst,
int* bytes_left);
Finally, we pad any remaining bytes of the key with zeroes.
bool NormalizeKey(TupleRow *tuple_row, uint8_t *dst, int *key_idx_over_budget=NULL)
static void NormalizeTimestamp(uint8_t *src, uint8_t *dst, bool is_asc)
static void NormalizeFloat(void *src, void *dst, bool is_asc)
static void NormalizeInt(void *src, void *dst, bool is_asc)
static bool NormalizeKeyColumn(const ColumnType &type, uint8_t null_bit, bool is_asc, uint8_t *value, uint8_t *dst, int *bytes_left)
static bool WriteNormalizedKey(const ColumnType &type, bool is_asc, uint8_t *value, uint8_t *dst, int *bytes_left)
std::vector< ExprContext * > key_expr_ctxs_
static void StoreFinalValue(ValueType value, void *dst, bool is_asc)
std::vector< bool > is_asc_
static bool WriteNullBit(uint8_t null_bit, uint8_t *value, uint8_t *dst, int *bytes_left)
Returns true if we went over the max key size while writing the null bit.
std::vector< bool > nulls_first_
KeyNormalizer(const std::vector< ExprContext * > &key_exprs_ctxs, int key_len, const std::vector< bool > &is_asc, const std::vector< bool > &nulls_first)