43 const auto gpu_offset_address_ptr =
reinterpret_cast<int8_t*
>(gpu_offset_address);
44 if (gpu_offset_address_ptr == 0) {
47 const auto offset_bytes =
48 static_cast<int64_t
>(gpu_offset_address_ptr - gpu_start_address_ptr);
56 const bool buff_is_provided)
58 , query_mem_desc_(query_mem_desc)
60 , buff_is_provided_(buff_is_provided)
84 const std::vector<TargetInfo>& targets) {
85 std::vector<int64_t> target_init_vals;
86 for (
const auto& target_info : targets) {
87 if (shared::is_any<kCOUNT, kCOUNT_IF, kAPPROX_COUNT_DISTINCT>(target_info.agg_kind)) {
88 target_init_vals.push_back(0);
91 if (!target_info.sql_type.get_notnull()) {
94 target_init_vals.push_back(target_info.is_agg ? init_val : 0);
96 target_init_vals.push_back(target_info.is_agg ? 0xdeadbeef : 0);
98 if (target_info.agg_kind ==
kAVG) {
99 target_init_vals.push_back(0);
100 }
else if (target_info.agg_kind ==
kSAMPLE && target_info.sql_type.is_geometry()) {
101 for (
int i = 1; i < 2 * target_info.sql_type.get_physical_coord_cols(); i++) {
102 target_init_vals.push_back(0);
104 }
else if (target_info.agg_kind ==
kSAMPLE && target_info.sql_type.is_varlen()) {
105 target_init_vals.push_back(0);
108 return target_init_vals;
112 const int8_t* byte_stream,
115 const auto& type_info = col_lazy_fetch.
type;
116 if (type_info.is_fp()) {
117 if (type_info.get_type() ==
kFLOAT) {
119 return *
reinterpret_cast<const int64_t*
>(may_alias_ptr(&fval));
122 return *
reinterpret_cast<const int64_t*
>(may_alias_ptr(&fval));
125 CHECK(type_info.is_integer() || type_info.is_decimal() || type_info.is_time() ||
126 type_info.is_timeinterval() || type_info.is_boolean() || type_info.is_string() ||
127 type_info.is_array());
130 type_bitwidth = type_info.get_comp_param();
132 type_bitwidth = 8 * type_info.get_size();
134 CHECK_EQ(
size_t(0), type_bitwidth % 8);
136 if (type_info.is_date_in_days()) {
137 val = type_info.get_comp_param() == 16
144 type_info.get_size() < type_info.get_logical_size() &&
145 type_info.get_comp_param())
153 auto encoding = type_info.get_compression();
158 type_info.get_dimension(),
159 type_info.get_scale(),
163 type_info.get_subtype());
DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_int_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
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)
bool takes_float_argument(const TargetInfo &target_info)
int64_t null_val_bit_pattern(const SQLTypeInfo &ti, const bool float_argument_input)
std::unordered_map< int64_t, int64_t > count_distinct_sets_mapping_
int8_t * getUnderlyingBuffer() const
size_t get_bit_width(const SQLTypeInfo &ti)
int64_t lazy_decode(const ColumnLazyFetchInfo &col_lazy_fetch, const int8_t *byte_stream, const int64_t pos)
DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_unsigned_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
This file includes the class specification for the buffer manager (BufferMgr), and related data struc...
Basic constructors and methods of the row set interface.
std::vector< int64_t > initialize_target_values_for_storage(const std::vector< TargetInfo > &targets)
DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_small_date_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int32_t null_val, const int64_t ret_null_val, const int64_t pos)
int64_t mappedPtr(const int64_t) const
int8_t * computeCpuOffset(const int64_t gpu_offset_address) const
const bool is_lazily_fetched
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)
DEVICE NEVER_INLINE float SUFFIX() fixed_width_float_decode_noinline(const int8_t *byte_stream, const int64_t pos)
DEVICE NEVER_INLINE double SUFFIX() fixed_width_double_decode_noinline(const int8_t *byte_stream, const int64_t pos)
Allocate GPU memory using GpuBuffers via DataMgr.