27 const std::vector<TargetInfo>& targets,
30 const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner,
31 const Executor* executor) {
32 return new ResultSet(targets,
36 executor ? executor->blockSize() : 0,
37 executor ? executor->gridSize() : 0);
41 std::vector<std::string>& varlen_storage) {
42 CHECK(result_set->serialized_varlen_buffer_.size() == 0);
45 result_set->serialized_varlen_buffer_.emplace_back(std::vector<std::string>());
48 result_set->serialized_varlen_buffer_.front().assign(varlen_storage.begin(),
49 varlen_storage.end());
54 const std::shared_ptr<RowSetMemoryOwner> _row_set_mem_owner)
55 :
query_mem_desc(_query_mem_desc), row_set_mem_owner(_row_set_mem_owner) {}
67 const std::vector<TargetInfo>& _targets,
69 const std::shared_ptr<RowSetMemoryOwner> _row_set_mem_owner)
70 : logical_values(nullptr)
74 , row_set_mem_owner(_row_set_mem_owner)
75 , executor(nullptr) {}
79 const std::vector<TargetInfo>& _targets,
82 const std::shared_ptr<RowSetMemoryOwner> _row_set_mem_owner,
83 const Executor* _executor)
84 : logical_values(_logical_values)
86 , device_type(_device_type)
88 , row_set_mem_owner(_row_set_mem_owner)
89 , executor(_executor) {}
98 std::vector<std::string> separate_varlen_storage;
100 auto storage = rs->allocateStorage();
101 auto buff = storage->getUnderlyingBuffer();
104 std::vector<std::shared_ptr<Analyzer::Expr>> row_literals;
115 if (constant->get_is_null()) {
119 const auto ti = constant->get_type_info();
120 const auto datum = constant->get_constval();
122 if (ti.is_string()) {
123 CHECK(ti.is_none_encoded_string());
124 if (
targets[j].sql_type.is_dict_encoded_string()) {
129 const auto sdp =
executor->getStringDictionaryProxy(
133 const auto string_id = sdp->getOrAddTransient(*datum.stringval);
135 std::memset(ptr, 0, 8);
136 std::memcpy(ptr, &string_id, 4);
142 separate_varlen_storage.push_back(*(datum.stringval));
145 *
reinterpret_cast<int64_t*
>(ptr) =
146 static_cast<int64_t>(separate_varlen_storage.size() - 1);
150 std::memset(ptr, 0, 8);
151 const auto sz = ti.get_size();
153 std::memcpy(ptr, &datum, sz);
161 if (separate_varlen_storage.size()) {
163 rs->setSeparateVarlenStorageValid(
true);
172 std::vector<TargetMetaInfo>& label_infos,
173 std::vector<RelLogicalValues::RowValues>& logical_values) {
176 logical_values.size() ? logical_values.front().size() : label_infos.size();
177 CHECK_EQ(label_infos.size(), numCols);
179 size_t numRows = logical_values.size();
186 std::vector<TargetInfo> target_infos;
188 for (
size_t col = 0; col < numCols; col++) {
189 SQLTypeInfo colType = label_infos[col].get_type_info();
191 false,
kSAMPLE, colType, colType,
true,
false,
false});
195 std::shared_ptr<RelLogicalValues> rel_logical_values =
HOST DEVICE int get_size() const
size_t size() const override
const std::vector< TargetInfo > & targets
size_t getNumRows() const
#define TRANSIENT_DICT_DB_ID
#define TRANSIENT_DICT_ID
ResultSet * makeResultSet(const std::vector< TargetInfo > &targets, const ExecutorDeviceType device_type, const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const Executor *executor)
size_t getRowSize() const
const Executor * executor
size_t getRowsSize() const
static std::shared_ptr< Analyzer::Expr > translateLiteral(const RexLiteral *)
const ExecutorDeviceType device_type
const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner
static ResultSet * create(std::vector< TargetMetaInfo > &label_infos, std::vector< RelLogicalValues::RowValues > &logical_values)
Basic constructors and methods of the row set interface.
const QueryMemoryDescriptor & query_mem_desc
ResultSetDefaultBuilder(const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner)
const RelLogicalValues * logical_values
const RexScalar * getValueAt(const size_t row_idx, const size_t col_idx) const
ResultSetLogicalValuesBuilder(const std::vector< TargetInfo > &targets, const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner)
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
ResultSet * build() override
void addColSlotInfo(const std::vector< std::tuple< int8_t, int8_t >> &slots_for_col)
static size_t getArenaBlockSize()
ResultSet * build() override
void addVarlenBuffer(ResultSet *result_set, std::vector< std::string > &varlen_storage)
const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner
const QueryMemoryDescriptor & query_mem_desc