23 #ifndef QUERYENGINE_RESULTSETBUFFERACCESSORS_H
24 #define QUERYENGINE_RESULTSETBUFFERACCESSORS_H
45 const bool separate_varlen_storage) {
50 (separate_varlen_storage && !target_info.
is_agg)) {
58 const bool separate_varlen_storage) {
76 const bool separate_varlen_storage) {
84 const size_t slot_idx,
85 const size_t key_count,
86 const size_t slot_count) {
87 return (key_count + slot_count) * entry_idx + (key_count + slot_idx);
91 const size_t slot_idx,
92 const size_t key_count,
93 const size_t entry_count) {
94 return (key_count + slot_idx) * entry_count + entry_idx;
98 const size_t key_count,
99 const size_t slot_count) {
100 return (key_count + slot_count) * entry_idx;
104 const size_t key_idx,
105 const size_t entry_count) {
106 return key_idx * entry_count + entry_idx;
112 const size_t target_slot_idx) {
113 auto new_target_ptr = target_ptr;
118 return new_target_ptr;
132 CHECK(consist_key_width);
144 const size_t entry_idx) {
146 return buff + entry_idx * row_bytes;
152 const size_t slot_idx,
154 const bool separate_varlen_storage) {
157 ((!separate_varlen_storage || target_info.
is_agg) &&
163 (!separate_varlen_storage || target_info.
is_agg) && !is_varlen_output_slot) {
174 const size_t slot_idx,
176 const bool separate_varlen_storage) {
201 const bool float_argument_input) {
202 if (fp_pair.second == 0) {
205 double dividend{0.0};
208 if (float_argument_input) {
209 dividend = shared::reinterpret_bits<float>(fp_pair.first);
213 dividend = shared::reinterpret_bits<double>(fp_pair.first);
218 <<
"Unsupported type for pair to double conversion: " << ti.
get_type_name();
222 dividend =
static_cast<double>(fp_pair.first);
228 : dividend /
static_cast<double>(fp_pair.second);
232 const bool float_argument_input) {
235 return shared::reinterpret_bits<int64_t>(
NULL_FLOAT);
238 return shared::reinterpret_bits<int64_t>(double_null_val);
249 switch (compact_sz) {
251 return *
reinterpret_cast<const int64_t*
>(ptr);
254 return *
reinterpret_cast<const int32_t*
>(ptr);
257 return *
reinterpret_cast<const int16_t*
>(ptr);
260 return *
reinterpret_cast<const int8_t*
>(ptr);
269 #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 getEntryCount() 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
const int8_t getPaddedSlotWidthBytes(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)