OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RowFunctionManager Struct Reference

#include <heavydbTypes.h>

+ Collaboration diagram for RowFunctionManager:

Public Member Functions

std::string getString (int32_t db_id, int32_t dict_id, int32_t string_id)
 
int32_t getDictDbId (const char *func_name, size_t arg_idx)
 
int32_t getDictId (const char *func_name, size_t arg_idx)
 
int32_t getOrAddTransient (int32_t db_id, int32_t dict_id, std::string str)
 
int8_t * makeBuffer (int64_t element_count, int64_t element_size)
 
 RowFunctionManager (const Executor *executor, const RelAlgExecutionUnit &ra_exe_unit)
 
std::string getString (int32_t db_id, int32_t dict_id, int32_t string_id)
 
int32_t getDictDbId (const std::string &func_name, size_t arg_idx)
 
int32_t getDictId (const std::string &func_name, size_t arg_idx)
 
int32_t getOrAddTransient (int32_t db_id, int32_t dict_id, std::string str)
 
int8_t * getStringDictionaryProxy (int32_t db_id, int32_t dict_id)
 
int8_t * makeBuffer (int64_t element_count, int64_t element_size)
 

Public Attributes

const Executorexecutor_
 
const RelAlgExecutionUnitra_exe_unit_
 

Detailed Description

Definition at line 298 of file heavydbTypes.h.

Constructor & Destructor Documentation

RowFunctionManager::RowFunctionManager ( const Executor executor,
const RelAlgExecutionUnit ra_exe_unit 
)
inline

Definition at line 59 of file RowFunctionManager.h.

60  : executor_(executor), ra_exe_unit_(ra_exe_unit) {}
const Executor * executor_
const RelAlgExecutionUnit & ra_exe_unit_

Member Function Documentation

int32_t RowFunctionManager::getDictDbId ( const std::string &  func_name,
size_t  arg_idx 
)
inline

Definition at line 68 of file RowFunctionManager.h.

References CHECK, CHECK_LT, anonymous_namespace{RowFunctionManager.h}::drop_suffix_impl(), anonymous_namespace{RowFunctionManager.h}::find_function_oper(), Analyzer::Expr::get_type_info(), Analyzer::FunctionOper::getArg(), Analyzer::FunctionOper::getArity(), ra_exe_unit_, RelAlgExecutionUnit::target_exprs, and UNREACHABLE.

68  {
69  std::string func_name_wo_suffix =
70  boost::algorithm::to_lower_copy(drop_suffix_impl(func_name));
71 
72  for (const auto& expr : ra_exe_unit_.target_exprs) {
73  for (const auto* op : find_function_oper(expr, func_name_wo_suffix)) {
74  const Analyzer::FunctionOper* function_oper =
75  dynamic_cast<const Analyzer::FunctionOper*>(op);
76  CHECK_LT(arg_idx, function_oper->getArity());
77  const SQLTypeInfo typ = function_oper->getArg(arg_idx)->get_type_info();
78  CHECK(typ.is_text_encoding_dict() || typ.is_text_encoding_dict_array());
79  return typ.getStringDictKey().db_id;
80  }
81  }
82  UNREACHABLE();
83  return 0;
84  }
std::vector< Analyzer::Expr * > target_exprs
size_t getArity() const
Definition: Analyzer.h:2746
#define UNREACHABLE()
Definition: Logger.h:338
std::string drop_suffix_impl(const std::string &str)
std::list< const Analyzer::Expr * > find_function_oper(const Analyzer::Expr *expr, const std::string &func_name_wo_suffix)
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
#define CHECK_LT(x, y)
Definition: Logger.h:303
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748
const RelAlgExecutionUnit & ra_exe_unit_
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

int32_t RowFunctionManager::getDictDbId ( const char *  func_name,
size_t  arg_idx 
)
inline

Definition at line 304 of file heavydbTypes.h.

References RowFunctionManager_getDictDbId().

304  {
306  reinterpret_cast<int8_t*>(this), func_name, arg_idx);
307  }
EXTENSION_NOINLINE_HOST int32_t RowFunctionManager_getDictDbId(int8_t *mgr_ptr, const char *func_name, size_t arg_idx)

+ Here is the call graph for this function:

int32_t RowFunctionManager::getDictId ( const std::string &  func_name,
size_t  arg_idx 
)
inline

Definition at line 86 of file RowFunctionManager.h.

References CHECK, CHECK_LT, anonymous_namespace{RowFunctionManager.h}::drop_suffix_impl(), anonymous_namespace{RowFunctionManager.h}::find_function_oper(), Analyzer::Expr::get_type_info(), Analyzer::FunctionOper::getArg(), Analyzer::FunctionOper::getArity(), ra_exe_unit_, RelAlgExecutionUnit::target_exprs, and UNREACHABLE.

86  {
87  std::string func_name_wo_suffix =
88  boost::algorithm::to_lower_copy(drop_suffix_impl(func_name));
89 
90  for (const auto& expr : ra_exe_unit_.target_exprs) {
91  for (const auto* op : find_function_oper(expr, func_name_wo_suffix)) {
92  const Analyzer::FunctionOper* function_oper =
93  dynamic_cast<const Analyzer::FunctionOper*>(op);
94  CHECK_LT(arg_idx, function_oper->getArity());
95  const SQLTypeInfo typ = function_oper->getArg(arg_idx)->get_type_info();
96  CHECK(typ.is_text_encoding_dict() || typ.is_text_encoding_dict_array());
97  return typ.getStringDictKey().dict_id;
98  }
99  }
100  UNREACHABLE();
101  return 0;
102  }
std::vector< Analyzer::Expr * > target_exprs
size_t getArity() const
Definition: Analyzer.h:2746
#define UNREACHABLE()
Definition: Logger.h:338
std::string drop_suffix_impl(const std::string &str)
std::list< const Analyzer::Expr * > find_function_oper(const Analyzer::Expr *expr, const std::string &func_name_wo_suffix)
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
#define CHECK_LT(x, y)
Definition: Logger.h:303
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748
const RelAlgExecutionUnit & ra_exe_unit_
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

int32_t RowFunctionManager::getDictId ( const char *  func_name,
size_t  arg_idx 
)
inline

Definition at line 309 of file heavydbTypes.h.

References RowFunctionManager_getDictId().

309  {
311  reinterpret_cast<int8_t*>(this), func_name, arg_idx);
312  }
EXTENSION_NOINLINE_HOST int32_t RowFunctionManager_getDictId(int8_t *mgr_ptr, const char *func_name, size_t arg_idx)

+ Here is the call graph for this function:

int32_t RowFunctionManager::getOrAddTransient ( int32_t  db_id,
int32_t  dict_id,
std::string  str 
)
inline

Definition at line 104 of file RowFunctionManager.h.

References executor_.

104  {
105  const auto proxy = executor_->getStringDictionaryProxy(
106  {db_id, dict_id}, executor_->getRowSetMemoryOwner(), true);
107  return proxy->getOrAddTransient(str);
108  }
const Executor * executor_
int32_t RowFunctionManager::getOrAddTransient ( int32_t  db_id,
int32_t  dict_id,
std::string  str 
)
inline

Definition at line 314 of file heavydbTypes.h.

References RowFunctionManager_getOrAddTransient().

Referenced by array_first_half__t32(), array_second_half__t32(), strtok_to_array(), strtok_to_array__1(), tarray_append(), text_encoding_dict_concat(), text_encoding_dict_concat2(), text_encoding_dict_concat3(), text_encoding_dict_copy(), and text_encoding_dict_copy_from().

314  {
316  reinterpret_cast<int8_t*>(this), db_id, dict_id, str);
317  }
EXTENSION_NOINLINE_HOST int32_t RowFunctionManager_getOrAddTransient(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id, std::string str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string RowFunctionManager::getString ( int32_t  db_id,
int32_t  dict_id,
int32_t  string_id 
)
inline

Definition at line 62 of file RowFunctionManager.h.

References executor_.

62  {
63  const auto proxy = executor_->getStringDictionaryProxy(
64  {db_id, dict_id}, executor_->getRowSetMemoryOwner(), true);
65  return proxy->getString(string_id);
66  }
const Executor * executor_
std::string RowFunctionManager::getString ( int32_t  db_id,
int32_t  dict_id,
int32_t  string_id 
)
inline

Definition at line 299 of file heavydbTypes.h.

References RowFunctionManager_getString().

Referenced by array_first_half__t32(), array_second_half__t32(), strtok_to_array__1(), tarray_append(), text_encoding_dict_concat(), text_encoding_dict_concat2(), text_encoding_dict_concat3(), text_encoding_dict_copy(), and text_encoding_dict_copy_from().

299  {
301  reinterpret_cast<int8_t*>(this), db_id, dict_id, string_id);
302  }
RUNTIME_EXPORT NEVER_INLINE HOST std::string RowFunctionManager_getString(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id, int32_t string_id)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int8_t* RowFunctionManager::getStringDictionaryProxy ( int32_t  db_id,
int32_t  dict_id 
)
inline

Definition at line 110 of file RowFunctionManager.h.

References executor_.

110  {
111  auto* proxy = executor_->getStringDictionaryProxy(
112  {db_id, dict_id}, executor_->getRowSetMemoryOwner(), true);
113  return reinterpret_cast<int8_t*>(proxy);
114  }
const Executor * executor_
int8_t* RowFunctionManager::makeBuffer ( int64_t  element_count,
int64_t  element_size 
)
inline

Definition at line 116 of file RowFunctionManager.h.

References checked_malloc(), and executor_.

116  {
117  int8_t* buffer =
118  reinterpret_cast<int8_t*>(checked_malloc((element_count + 1) * element_size));
119  executor_->getRowSetMemoryOwner()->addVarlenBuffer(buffer);
120  return buffer;
121  }
const Executor * executor_
void * checked_malloc(const size_t size)
Definition: checked_alloc.h:45

+ Here is the call graph for this function:

int8_t* RowFunctionManager::makeBuffer ( int64_t  element_count,
int64_t  element_size 
)
inline

Definition at line 319 of file heavydbTypes.h.

References RowFunctionManager_makeBuffer().

319  {
321  reinterpret_cast<int8_t*>(this), element_count, element_size);
322  }
EXTENSION_NOINLINE_HOST int8_t * RowFunctionManager_makeBuffer(int8_t *mgr_ptr, int64_t count, int64_t size)

+ Here is the call graph for this function:

Member Data Documentation

const Executor* RowFunctionManager::executor_
const RelAlgExecutionUnit& RowFunctionManager::ra_exe_unit_

Definition at line 125 of file RowFunctionManager.h.

Referenced by getDictDbId(), and getDictId().


The documentation for this struct was generated from the following files: