23 #ifndef QUERYENGINE_RESULTSETBUFFERACCESSORS_H
24 #define QUERYENGINE_RESULTSETBUFFERACCESSORS_H
46 const bool separate_varlen_storage) {
51 (separate_varlen_storage && !target_info.
is_agg)) {
59 const bool separate_varlen_storage) {
77 const bool separate_varlen_storage) {
85 const size_t slot_idx,
86 const size_t key_count,
87 const size_t slot_count) {
88 return (key_count + slot_count) * entry_idx + (key_count + slot_idx);
92 const size_t slot_idx,
93 const size_t key_count,
94 const size_t entry_count) {
95 return (key_count + slot_idx) * entry_count + entry_idx;
99 const size_t key_count,
100 const size_t slot_count) {
101 return (key_count + slot_count) * entry_idx;
105 const size_t key_idx,
106 const size_t entry_count) {
107 return key_idx * entry_count + entry_idx;
113 const size_t target_slot_idx) {
114 auto new_target_ptr = target_ptr;
116 return new_target_ptr;
130 CHECK(consist_key_width);
142 const size_t entry_idx) {
144 return buff + entry_idx * row_bytes;
150 const size_t slot_idx,
152 const bool separate_varlen_storage) {
155 ((!separate_varlen_storage || target_info.
is_agg) &&
161 (!separate_varlen_storage || target_info.
is_agg) && !is_varlen_output_slot) {
172 const size_t slot_idx,
174 const bool separate_varlen_storage) {
199 const bool float_argument_input) {
200 if (fp_pair.second == 0) {
203 double dividend{0.0};
206 if (float_argument_input) {
207 dividend = shared::reinterpret_bits<float>(fp_pair.first);
211 dividend = shared::reinterpret_bits<double>(fp_pair.first);
216 <<
"Unsupported type for pair to double conversion: " << ti.
get_type_name();
220 dividend =
static_cast<double>(fp_pair.first);
226 : dividend /
static_cast<double>(fp_pair.second);
230 const bool float_argument_input) {
233 return shared::reinterpret_bits<int64_t>(
NULL_FLOAT);
236 return shared::reinterpret_bits<int64_t>(double_null_val);
247 switch (compact_sz) {
249 return *
reinterpret_cast<const int64_t*
>(ptr);
252 return *
reinterpret_cast<const int32_t*
>(ptr);
255 return *
reinterpret_cast<const int16_t*
>(ptr);
258 return *
reinterpret_cast<const int8_t*
>(ptr);
267 #endif // QUERYENGINE_RESULTSETBUFFERACCESSORS_H
size_t slot_offset_rowwise(const size_t entry_idx, const size_t slot_idx, const size_t key_count, const size_t slot_count)
bool slotIsVarlenOutput(const size_t slot_idx) const
size_t slot_offset_colwise(const size_t entry_idx, const size_t slot_idx, const size_t key_count, const size_t entry_count)
T advance_to_next_columnar_target_buff(T target_ptr, const QueryMemoryDescriptor &query_mem_desc, const size_t target_slot_idx)
HOST DEVICE int get_scale() const
bool hasKeylessHash() const
Macros and functions for groupby buffer compaction.
size_t get_slot_off_quad(const QueryMemoryDescriptor &query_mem_desc)
size_t getEffectiveKeyWidth() const
int64_t read_int_from_buff(const int8_t *ptr, const int8_t compact_sz)
double pair_to_double(const std::pair< int64_t, int64_t > &fp_pair, const SQLTypeInfo &ti, const bool float_argument_input)
HOST DEVICE SQLTypes get_type() const
T advance_target_ptr_row_wise(T target_ptr, const TargetInfo &target_info, const size_t slot_idx, const QueryMemoryDescriptor &query_mem_desc, const bool separate_varlen_storage)
int64_t null_val_bit_pattern(const SQLTypeInfo &ti, const bool float_argument_input)
double inline_fp_null_val(const SQL_TYPE_INFO &ti)
size_t get_slots_for_geo_target(const TargetInfo &target_info, const bool separate_varlen_storage)
#define LOG_IF(severity, condition)
bool is_varlen_projection
size_t advance_slot(const size_t j, const TargetInfo &target_info, const bool separate_varlen_storage)
size_t getGroupbyColCount() const
bool usesFlatBuffer() const
const int8_t getPaddedSlotWidthBytes(const size_t slot_idx) const
int64_t getPaddedSlotBufferSize(const size_t slot_idx) const
T row_ptr_rowwise(T buff, const QueryMemoryDescriptor &query_mem_desc, const size_t entry_idx)
size_t key_offset_colwise(const size_t entry_idx, const size_t key_idx, const size_t entry_count)
bool is_real_str_or_array(const TargetInfo &target_info)
HOST DEVICE EncodingType get_compression() const
size_t get_row_bytes(const QueryMemoryDescriptor &query_mem_desc)
std::string get_type_name() const
size_t key_offset_rowwise(const size_t entry_idx, const size_t key_count, const size_t slot_count)
Descriptor for the result set buffer layout.
bool didOutputColumnar() const
size_t getRowWidth() const
uint64_t exp_to_scale(const unsigned exp)
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
T advance_target_ptr_col_wise(T target_ptr, const TargetInfo &target_info, const size_t slot_idx, const QueryMemoryDescriptor &query_mem_desc, const bool separate_varlen_storage)
size_t get_slots_for_target(const TargetInfo &target_info, const bool separate_varlen_storage)
T get_cols_ptr(T buff, const QueryMemoryDescriptor &query_mem_desc)
int get_physical_coord_cols() const
size_t getColOffInBytes(const size_t col_idx) const
size_t get_key_bytes_rowwise(const QueryMemoryDescriptor &query_mem_desc)
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)