23 #ifndef QUERYENGINE_RESULTSETSTORAGE_H
24 #define QUERYENGINE_RESULTSETSTORAGE_H
101 const bool buff_is_provided);
105 const std::vector<std::string>& serialized_varlen_buffer,
107 const size_t executor_id)
const;
110 const std::vector<std::string>& serialized_varlen_buffer)
const;
116 template <
class KeyType>
119 template <
class KeyType>
121 int64_t* new_buff_i64,
122 const size_t new_entry_count,
123 const size_t key_count,
124 const size_t row_qw_count,
125 const int64_t* src_buff,
126 const size_t key_byte_width)
const;
133 const int8_t* that_ptr1,
134 const size_t target_logical_idx,
139 const int8_t warp_count,
140 const bool is_columnar,
141 const bool replace_bitmap_ptr_with_bitmap_sz,
142 std::vector<int64_t>& agg_vals,
144 const std::vector<TargetInfo>& targets,
145 const std::vector<int64_t>& agg_init_vals);
150 const int8_t* that_buff,
152 const size_t start_index,
153 const size_t end_index,
154 const std::vector<std::string>& serialized_varlen_buffer,
155 const size_t executor_id)
const;
159 const int8_t* that_buff)
const;
161 bool isEmptyEntry(
const size_t entry_idx,
const int8_t* buff)
const;
166 const int8_t* that_buff,
168 const size_t that_entry_count,
172 const int64_t* that_buff,
173 const size_t that_entry_idx,
174 const size_t that_entry_count,
180 const size_t this_slot,
181 const int64_t* that_buff,
182 const size_t that_entry_count,
183 const size_t that_slot,
185 const size_t target_logical_idx,
186 const size_t target_slot_idx,
187 const size_t init_agg_val_idx,
193 const size_t target_slot_idx,
194 const size_t init_agg_val_idx,
195 const int8_t* that_ptr1)
const;
200 const int8_t* that_ptr1,
201 const int8_t* that_ptr2,
203 const size_t target_logical_idx,
204 const size_t target_slot_idx,
205 const size_t init_agg_val_idx,
207 const size_t first_slot_idx_for_target,
208 const std::vector<std::string>& serialized_varlen_buffer)
const;
211 const int8_t* that_ptr1,
212 const size_t target_logical_idx,
256 namespace result_set {
259 const int8_t* byte_stream,
262 void fill_empty_key(
void* key_ptr,
const size_t key_count,
const size_t key_width);
265 const bool float_argument_input,
272 const uint32_t groups_buffer_entry_count,
274 const uint32_t key_count,
275 const size_t key_width,
277 const int64_t* that_buff_i64,
278 const size_t that_entry_idx,
279 const size_t that_entry_count,
280 const uint32_t row_size_quad);
283 const std::vector<TargetInfo>& targets);
287 #endif // QUERYENGINE_RESULTSETSTORAGE_H
GroupValueInfo get_group_value_reduction(int64_t *groups_buffer, const uint32_t groups_buffer_entry_count, const int64_t *key, const uint32_t key_count, const size_t key_width, const QueryMemoryDescriptor &query_mem_desc, const int64_t *that_buff_i64, const size_t that_entry_idx, const size_t that_entry_count, const uint32_t row_size_quad)
size_t getEntryCount() const
void moveOneEntryToBuffer(const size_t entry_index, int64_t *new_buff_i64, const size_t new_entry_count, const size_t key_count, const size_t row_qw_count, const int64_t *src_buff, const size_t key_byte_width) const
bool isEmptyEntry(const size_t entry_idx, const int8_t *buff) const
const std::vector< TargetInfo > targets_
ALWAYS_INLINE void reduceOneSlot(int8_t *this_ptr1, int8_t *this_ptr2, const int8_t *that_ptr1, const int8_t *that_ptr2, const TargetInfo &target_info, const size_t target_logical_idx, const size_t target_slot_idx, const size_t init_agg_val_idx, const ResultSetStorage &that, const size_t first_slot_idx_for_target, const std::vector< std::string > &serialized_varlen_buffer) const
void setEntryCount(const size_t val)
std::vector< int64_t > target_init_vals_
void initializeColWise() const
void reduceOneEntryBaseline(int8_t *this_buff, const int8_t *that_buff, const size_t i, const size_t that_entry_count, const ResultSetStorage &that) const
bool isEmptyEntryColumnar(const size_t entry_idx, const int8_t *buff) const
Utility functions for easy access to the result set buffers.
int64_t gpu_start_address
void addCountDistinctSetPointerMapping(const int64_t remote_ptr, const int64_t ptr)
ResultSetStorage(const std::vector< TargetInfo > &targets, const QueryMemoryDescriptor &query_mem_desc, int8_t *buff, const bool buff_is_provided)
void initializeRowWise() const
void reduceOneApproxQuantileSlot(int8_t *this_ptr1, const int8_t *that_ptr1, const size_t target_logical_idx, const ResultSetStorage &that) const
void initializeBaselineValueSlots(int64_t *this_entry_slots) const
High-level representation of SQL values.
void reduceOneSlotBaseline(int64_t *this_buff, const size_t this_slot, const int64_t *that_buff, const size_t that_entry_count, const size_t that_slot, const TargetInfo &target_info, const size_t target_logical_idx, const size_t target_slot_idx, const size_t init_agg_val_idx, const ResultSetStorage &that) const
std::shared_ptr< VarlenOutputInfo > varlen_output_info_
std::unordered_map< int64_t, int64_t > count_distinct_sets_mapping_
int8_t * getUnderlyingBuffer() const
const VarlenOutputInfo * getVarlenOutputInfo() const
const bool buff_is_provided_
int8_t get_width_for_slot(const size_t target_slot_idx, const bool float_argument_input, const QueryMemoryDescriptor &query_mem_desc)
void reduceOneEntrySlotsBaseline(int64_t *this_entry_slots, const int64_t *that_buff, const size_t that_entry_idx, const size_t that_entry_count, const ResultSetStorage &that) const
size_t get_byteoff_of_slot(const size_t slot_idx, const QueryMemoryDescriptor &query_mem_desc)
void copyKeyColWise(const size_t entry_idx, int8_t *this_buff, const int8_t *that_buff) const
void reduceOneCountDistinctSlot(int8_t *this_ptr1, const int8_t *that_ptr1, const size_t target_logical_idx, const ResultSetStorage &that) const
void moveEntriesToBuffer(int8_t *new_buff, const size_t new_entry_count) const
void fill_empty_key(void *key_ptr, const size_t key_count, const size_t key_width)
void updateEntryCount(const size_t new_entry_count)
size_t binSearchRowCount() const
std::pair< int64_t *, bool > GroupValueInfo
int64_t lazy_decode(const ColumnLazyFetchInfo &col_lazy_fetch, const int8_t *byte_stream, const int64_t pos)
void fillOneEntryColWise(const std::vector< int64_t > &entry)
void reduce(const ResultSetStorage &that, const std::vector< std::string > &serialized_varlen_buffer, const ReductionCode &reduction_code, const size_t executor_id) const
size_t getEntryCount() const
std::vector< int64_t > initialize_target_values_for_storage(const std::vector< TargetInfo > &targets)
void reduceEntriesNoCollisionsColWise(int8_t *this_buff, const int8_t *that_buff, const ResultSetStorage &that, const size_t start_index, const size_t end_index, const std::vector< std::string > &serialized_varlen_buffer, const size_t executor_id) const
ALWAYS_INLINE void reduceOneSlotSingleValue(int8_t *this_ptr1, const TargetInfo &target_info, const size_t target_slot_idx, const size_t init_agg_val_idx, const int8_t *that_ptr1) const
int64_t mappedPtr(const int64_t) const
int8_t * computeCpuOffset(const int64_t gpu_offset_address) const
const bool is_lazily_fetched
Estimators to be used when precise cardinality isn't useful.
void fillOneEntryRowWise(const std::vector< int64_t > &entry)
void rewriteAggregateBufferOffsets(const std::vector< std::string > &serialized_varlen_buffer) const
static bool reduceSingleRow(const int8_t *row_ptr, const int8_t warp_count, const bool is_columnar, const bool replace_bitmap_ptr_with_bitmap_sz, std::vector< int64_t > &agg_vals, const QueryMemoryDescriptor &query_mem_desc, const std::vector< TargetInfo > &targets, const std::vector< int64_t > &agg_init_vals)
QueryMemoryDescriptor query_mem_desc_