17 #ifdef EXECUTE_INCLUDE
41 "set_output_row_size: expected non-negative row size but got " +
44 mgr->allocate_output_buffers(num_rows);
63 int64_t output_item_values_total_number) {
65 if (output_item_values_total_number < 0) {
67 "set_output_item_values_total_number: expected non-negative size but "
76 int64_t output_item_values_total_number) {
79 reinterpret_cast<int8_t*>(mgr), index, output_item_values_total_number);
95 int64_t output_array_values_total_number) {
97 if (output_array_values_total_number < 0) {
99 "set_output_array_values_total_number: expected non-negative size but "
108 int64_t output_array_values_total_number) {
111 reinterpret_cast<int8_t*>(mgr), index, output_array_values_total_number);
125 TableFunctionManager_register_output_column(int8_t* mgr_ptr, int32_t index, int8_t* ptr) {
140 if (message !=
nullptr) {
167 return reinterpret_cast<int8_t*
>(mgr);
173 const uint8_t* raw_bytes,
174 const size_t num_bytes,
178 mgr->
set_metadata(key, raw_bytes, num_bytes, value_type);
184 const uint8_t*& raw_bytes,
189 mgr->
get_metadata(key, raw_bytes, num_bytes, value_type);
221 return mgr->
getString(db_id, dict_id, string_id);
226 int64_t element_count,
227 int64_t element_size) {
230 return mgr->
makeBuffer(element_count, element_size);
245 const int64_t expected_numel,
251 if (m.isNestedArray()) {
253 if (!m.isSpecified(index)) {
254 if (expected_numel < 0) {
256 throw std::runtime_error(
"getArray failed: " + ::
toString(status));
259 status = m.setItem(index,
nullptr, expected_numel);
260 if (status != FlatBufferManager::Status::Success) {
262 throw std::runtime_error(
"getArray failed[setItem]: " + ::
toString(status));
266 status = m.getItem(index, item);
267 if (status == FlatBufferManager::Status::Success) {
274 if (expected_numel >= 0 && expected_numel != item.
nof_values) {
276 throw std::runtime_error(
"getArray failed: unexpected size " +
284 throw std::runtime_error(
"getArray failed: " + ::
toString(status));
293 const int64_t expected_numel,
305 bool is_null =
false;
306 auto status = m.
isNull(index, is_null);
308 if (status != FlatBufferManager::Status::Success) {
309 throw std::runtime_error(
"isNull failed: " + ::
toString(status));
318 auto status = m.
setNull(index);
320 if (status != FlatBufferManager::Status::Success) {
321 throw std::runtime_error(
"setNull failed: " + ::
toString(status));
336 status = m.setItem(index, ptr, size);
339 if (status != FlatBufferManager::Status::Success) {
340 throw std::runtime_error(
"setItem failed: " + ::
toString(status));
353 CHECK_EQ(sizeof_T, m.getValueSize());
365 if (m.isSpecified(index)) {
367 status = FlatBufferManager::Status::Success;
373 status = m.concatItem(index, ptr, size);
376 if (status != FlatBufferManager::Status::Success) {
377 throw std::runtime_error(
"concatItem failed: " + ::
toString(status));
390 CHECK_EQ(sizeof_T, m.getValueSize());
394 #endif // EXECUTE_INCLUDE
void set_output_column(int32_t index, int8_t *ptr)
std::string getString(int32_t db_id, int32_t dict_id, int32_t string_id)
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
EXTENSION_NOINLINE_HOST void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
void get_metadata(const std::string &key, T &value)
EXTENSION_NOINLINE_HOST int32_t table_function_success_code()
EXTENSION_NOINLINE_HOST int8_t * TableFunctionManager_get_singleton()
EXTENSION_NOINLINE_HOST void ColumnArray_setNull(int8_t *flatbuffer, int64_t index)
void set_error_message(const char *msg)
EXTENSION_NOINLINE_HOST void ColumnArray_getArray(int8_t *flatbuffer, const int64_t index, const int64_t expected_numel, int8_t *&ptr, int64_t &size, bool &is_null)
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_getNewDictDbId(int8_t *mgr_ptr)
int32_t getOrAddTransient(int32_t db_id, int32_t dict_id, std::string str)
EXTENSION_NOINLINE_HOST void ColumnArray_concatItem(int8_t *flatbuffer, int64_t index, const int8_t *ptr, int64_t size, bool is_null, int64_t sizeof_T)
EXTENSION_NOINLINE_HOST void TableFunctionManager_set_output_item_values_total_number(int8_t *mgr_ptr, int32_t index, int64_t output_item_values_total_number)
EXTENSION_NOINLINE_HOST void ColumnArray_setItem(int8_t *flatbuffer, int64_t index, const int8_t *ptr, int64_t size, bool is_null, int64_t sizeof_T)
EXTENSION_NOINLINE_HOST void ColumnArray_concatArray(int8_t *flatbuffer, int64_t index, const int8_t *ptr, int64_t size, bool is_null)
EXTENSION_NOINLINE_HOST void TableFunctionManager_get_metadata(int8_t *mgr_ptr, const char *key, const uint8_t *&raw_bytes, size_t &num_bytes, TableFunctionMetadataType &value_type)
static TableFunctionManager *& get_singleton_internal()
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_error_message(int8_t *mgr_ptr, const char *message)
EXTENSION_NOINLINE_HOST int8_t * TableFunctionManager_getStringDictionaryProxy(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id)
CONSTEXPR DEVICE bool is_null(const T &value)
std::string TableFunctionManager_getString(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id, int32_t string_id)
EXTENSION_NOINLINE_HOST int8_t * TableFunctionManager_makeBuffer(int8_t *mgr_ptr, int64_t count, int64_t size)
std::string toString(const Executor::ExtModuleKinds &kind)
EXTENSION_NOINLINE_HOST int32_t table_function_error(const char *message)
StringDictionaryProxy * getStringDictionaryProxy(int32_t db_id, int32_t dict_id)
EXTENSION_NOINLINE_HOST bool ColumnArray_isNull(int8_t *flatbuffer, int64_t index)
int8_t * makeBuffer(int64_t element_count, int64_t element_size)
EXTENSION_NOINLINE_HOST void ColumnArray_getItem(int8_t *flatbuffer, const int64_t index, const int64_t expected_numel, int8_t *&ptr, int64_t &size, bool &is_null, int64_t sizeof_T)
EXTENSION_NOINLINE_HOST void TableFunctionManager_set_metadata(int8_t *mgr_ptr, const char *key, const uint8_t *raw_bytes, const size_t num_bytes, const TableFunctionMetadataType value_type)
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
EXTENSION_NOINLINE_HOST void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
EXTENSION_NOINLINE_HOST void TableFunctionManager_set_output_row_size(int8_t *mgr_ptr, int64_t num_rows)
void set_metadata(const std::string &key, const T &value)
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_getNewDictId(int8_t *mgr_ptr)
HOST DEVICE Status isNull(const int64_t index[NDIM], const size_t n, bool &is_null)
EXTENSION_NOINLINE_HOST void TableFunctionManager_set_output_array_values_total_number(int8_t *mgr_ptr, int32_t index, int64_t output_array_values_total_number)
EXTENSION_NOINLINE_HOST void ColumnArray_setArray(int8_t *flatbuffer, int64_t index, const int8_t *ptr, int64_t size, bool is_null)
HOST DEVICE Status setNull(int64_t index)
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_getOrAddTransient(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id, std::string str)