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

#include <heavydbTypes.h>

+ Collaboration diagram for TableFunctionManager:

Public Member Functions

void set_output_array_values_total_number (int32_t index, int64_t output_array_values_total_number)
 
void set_output_row_size (int64_t num_rows)
 
void disable_output_allocations ()
 
void enable_output_allocations ()
 
int32_t error_message (const char *message)
 
template<typename T >
void set_metadata (const std::string &key, const T &value)
 
template<typename T >
void get_metadata (const std::string &key, T &value)
 
int32_t getNewDictId ()
 
std::string getString (int32_t dict_id, int32_t string_id)
 
const char * getCString (int32_t dict_id, int32_t string_id)
 
int32_t getOrAddTransient (int32_t dict_id, std::string str)
 
std::string toString () const
 
 TableFunctionManager (const TableFunctionExecutionUnit &exe_unit, Executor *executor, std::vector< const int8_t * > &col_buf_ptrs, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, bool is_singleton)
 
size_t get_ncols () const
 
size_t get_nrows () const
 
void check_thread_id () const
 
void set_output_column (int32_t index, int8_t *ptr)
 
void set_output_array_values_total_number (int32_t index, int64_t output_array_values_total_number)
 
void allocate_output_buffers (int64_t output_num_rows)
 
const char * get_error_message () const
 
void set_error_message (const char *msg)
 
void set_metadata (const char *key, const uint8_t *raw_bytes, const size_t num_bytes, const TableFunctionMetadataType value_type) const
 
void get_metadata (const char *key, const uint8_t *&raw_bytes, size_t &num_bytes, TableFunctionMetadataType &value_type) const
 
int32_t getNewDictId ()
 
std::string getString (int32_t dict_id, int32_t string_id)
 
const char * getCString (int32_t dict_id, int32_t string_id)
 
const int32_t getOrAddTransient (int32_t dict_id, const std::string &str)
 
bool isSingleton () const
 
 ~TableFunctionManager ()
 

Static Public Member Functions

static TableFunctionManagerget_singleton ()
 
static TableFunctionManager *& get_singleton ()
 

Public Attributes

bool output_allocations_disabled false
 
std::unique_ptr
< QueryMemoryInitializer
query_buffers
 

Private Member Functions

void lock ()
 
void unlock ()
 

Static Private Member Functions

static void set_singleton (TableFunctionManager *instance)
 

Private Attributes

const TableFunctionExecutionUnitexe_unit_
 
Executorexecutor_
 
std::vector< const int8_t * > & col_buf_ptrs_
 
std::shared_ptr
< RowSetMemoryOwner
row_set_mem_owner_
 
std::vector< int64_t * > output_col_buf_ptrs
 
size_t output_num_rows_
 
std::vector< int64_t > output_array_values_total_number_
 
std::vector< int8_t * > output_column_ptrs
 
bool is_singleton_
 
std::thread::id thread_id_
 
std::string error_message_
 

Detailed Description

Definition at line 1170 of file heavydbTypes.h.

Constructor & Destructor Documentation

TableFunctionManager::TableFunctionManager ( const TableFunctionExecutionUnit exe_unit,
Executor executor,
std::vector< const int8_t * > &  col_buf_ptrs,
std::shared_ptr< RowSetMemoryOwner row_set_mem_owner,
bool  is_singleton 
)
inline

Definition at line 59 of file TableFunctionManager.h.

References get_ncols(), isSingleton(), output_array_values_total_number_, output_col_buf_ptrs, output_column_ptrs, and set_singleton().

64  : exe_unit_(exe_unit)
65  , executor_(executor)
66  , col_buf_ptrs_(col_buf_ptrs)
67  , row_set_mem_owner_(row_set_mem_owner)
68  , output_num_rows_(-1)
69  , is_singleton_(is_singleton)
70  , thread_id_(std::this_thread::get_id()) {
71  if (isSingleton()) {
72  set_singleton(this); // start of singleton life
73  }
74  auto num_out_columns = get_ncols();
75  output_col_buf_ptrs.reserve(num_out_columns);
76  output_column_ptrs.reserve(num_out_columns);
77  output_array_values_total_number_.reserve(num_out_columns);
78  for (size_t i = 0; i < num_out_columns; i++) {
79  output_col_buf_ptrs.emplace_back(nullptr);
80  output_column_ptrs.emplace_back(nullptr);
81  output_array_values_total_number_.emplace_back(-1);
82  }
83  }
std::vector< const int8_t * > & col_buf_ptrs_
const TableFunctionExecutionUnit & exe_unit_
std::vector< int8_t * > output_column_ptrs
std::vector< int64_t * > output_col_buf_ptrs
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
std::vector< int64_t > output_array_values_total_number_
static void set_singleton(TableFunctionManager *instance)

+ Here is the call graph for this function:

TableFunctionManager::~TableFunctionManager ( )
inline

Definition at line 261 of file TableFunctionManager.h.

References isSingleton(), and set_singleton().

261  {
262  if (isSingleton()) {
263  set_singleton(nullptr); // end of singleton life
264  }
265  }
static void set_singleton(TableFunctionManager *instance)

+ Here is the call graph for this function:

Member Function Documentation

void TableFunctionManager::allocate_output_buffers ( int64_t  output_num_rows)
inline

Definition at line 120 of file TableFunctionManager.h.

References QueryMemoryDescriptor::addColSlotInfo(), QueryMemoryDescriptor::addColSlotInfoFlatBuffer(), align_to_int64(), CHECK, CHECK_EQ, CHECK_NE, check_thread_id(), col_buf_ptrs_, CPU, exe_unit_, executor_, get_ncols(), getVarlenArrayBufferSize(), initializeVarlenArray(), output_array_values_total_number_, output_col_buf_ptrs, output_column_ptrs, output_num_rows_, query_buffers, query_mem_desc, row_set_mem_owner_, QueryMemoryDescriptor::setOutputColumnar(), Column< T >::size(), TableFunction, TableFunctionExecutionUnit::target_exprs, and toString().

120  {
121  check_thread_id();
123  size_t(-1)); // re-allocation of output buffers is not supported
124 
125  output_num_rows_ = output_num_rows;
126  auto num_out_columns = get_ncols();
128  output_num_rows, // divide by row multiplier???
130  /*is_table_function=*/true);
131  query_mem_desc.setOutputColumnar(true);
132 
133  for (size_t i = 0; i < num_out_columns; i++) {
134  // All outputs have padded width set to logical column width
135  auto ti = exe_unit_.target_exprs[i]->get_type_info();
136  if (ti.is_array()) {
138  -1); // set_output_array_values_total_number(i, ...) is not called
139  /*
140  Here we compute the byte size of flatbuffer and store it in
141  query memory descriptor's ColSlotContext instance. The
142  flatbuffer memory will be allocated in
143  QueryMemoryInitializer constructor and the memory will be
144  initialized below.
145  */
146  const int64_t flatbuffer_size = getVarlenArrayBufferSize(
148  query_mem_desc.addColSlotInfoFlatBuffer(
149  flatbuffer_size); // used by QueryMemoryInitializer
150  } else {
151  const size_t col_width = ti.get_size();
152  query_mem_desc.addColSlotInfo({std::make_tuple(col_width, col_width)});
153  }
154  }
155 
156  // The members layout of Column must match with Column defined in
157  // heavydbTypes.h
158  struct Column {
159  int8_t* ptr;
160  int64_t size;
161  // just for debugging:
162  std::string toString() const {
163  return "Column{" + ::toString(ptr) + ", " + ::toString(size) + "}";
164  }
165  };
166  // We do not init output buffers for CPU currently, so CPU
167  // table functions are expected to handle their own initialization
168  query_buffers = std::make_unique<QueryMemoryInitializer>(
169  exe_unit_,
171  /*device_id=*/0,
173  (output_num_rows_ == 0 ? 1 : output_num_rows_),
174  std::vector<std::vector<const int8_t*>>{col_buf_ptrs_},
175  std::vector<std::vector<uint64_t>>{{0}}, // frag offsets
177  nullptr,
178  executor_);
179  if (output_num_rows_ != 0) {
180  auto group_by_buffers_ptr = query_buffers->getGroupByBuffersPtr();
181  CHECK(group_by_buffers_ptr);
182  auto output_buffers_ptr = reinterpret_cast<int8_t*>(group_by_buffers_ptr[0]);
183  for (size_t i = 0; i < num_out_columns; i++) {
184  Column* col = reinterpret_cast<Column*>(output_column_ptrs[i]);
185  CHECK(col);
186  // set the members of output Column instances:
187  output_col_buf_ptrs[i] = reinterpret_cast<int64_t*>(output_buffers_ptr);
188  col->ptr = output_buffers_ptr;
189  col->size = output_num_rows_;
190 
191  auto ti = exe_unit_.target_exprs[i]->get_type_info();
192  if (ti.is_array()) {
193  FlatBufferManager m{output_buffers_ptr};
195  m, output_num_rows_, output_array_values_total_number_[i], ti);
196  output_buffers_ptr = align_to_int64(output_buffers_ptr + m.flatbufferSize());
197  } else {
198  const size_t col_width = ti.get_size();
199  output_buffers_ptr =
200  align_to_int64(output_buffers_ptr + col_width * output_num_rows_);
201  }
202  }
203  }
204  }
std::unique_ptr< QueryMemoryInitializer > query_buffers
#define CHECK_EQ(x, y)
Definition: Logger.h:297
std::vector< const int8_t * > & col_buf_ptrs_
const TableFunctionExecutionUnit & exe_unit_
DEVICE int64_t size() const
Definition: heavydbTypes.h:726
std::vector< int8_t * > output_column_ptrs
std::vector< int64_t * > output_col_buf_ptrs
#define CHECK_NE(x, y)
Definition: Logger.h:298
void initializeVarlenArray(FlatBufferManager &m, int64_t items_count, int64_t max_nof_values, const SQLTypeInfo &ti)
Definition: sqltypes.h:1445
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
std::vector< int64_t > output_array_values_total_number_
int64_t getVarlenArrayBufferSize(int64_t items_count, int64_t max_nof_values, const SQLTypeInfo &ti)
Definition: sqltypes.h:1425
#define CHECK(condition)
Definition: Logger.h:289
std::vector< Analyzer::Expr * > target_exprs
std::string toString() const
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)

+ Here is the call graph for this function:

void TableFunctionManager::check_thread_id ( ) const
inline

Definition at line 91 of file TableFunctionManager.h.

References thread_id_.

Referenced by allocate_output_buffers(), get_error_message(), set_error_message(), and set_output_column().

91  {
92  if (std::this_thread::get_id() != thread_id_) {
93  throw std::runtime_error(
94  "TableFunctionManager instance accessed from an alien thread!");
95  }
96  }

+ Here is the caller graph for this function:

void TableFunctionManager::disable_output_allocations ( )
inline

Definition at line 1187 of file heavydbTypes.h.

Referenced by linear_reg_fit_predict__cpu_template().

1187 { output_allocations_disabled = true; }

+ Here is the caller graph for this function:

void TableFunctionManager::enable_output_allocations ( )
inline

Definition at line 1189 of file heavydbTypes.h.

Referenced by linear_reg_fit_predict__cpu_template().

1189 { output_allocations_disabled = false; }

+ Here is the caller graph for this function:

int32_t TableFunctionManager::error_message ( const char *  message)
inline

Definition at line 1191 of file heavydbTypes.h.

References TableFunctionManager_error_message().

1191  {
1192  return TableFunctionManager_error_message(reinterpret_cast<int8_t*>(this), message);
1193  }
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_error_message(int8_t *mgr_ptr, const char *message)

+ Here is the call graph for this function:

const char* TableFunctionManager::get_error_message ( ) const
inline

Definition at line 206 of file TableFunctionManager.h.

References check_thread_id(), and error_message_.

206  {
207  check_thread_id();
208  return error_message_.c_str();
209  }

+ Here is the call graph for this function:

void TableFunctionManager::get_metadata ( const char *  key,
const uint8_t *&  raw_bytes,
size_t &  num_bytes,
TableFunctionMetadataType value_type 
) const
inline

Definition at line 224 of file TableFunctionManager.h.

References CHECK, and row_set_mem_owner_.

227  {
229  row_set_mem_owner_->getTableFunctionMetadata(key, raw_bytes, num_bytes, value_type);
230  }
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
#define CHECK(condition)
Definition: Logger.h:289
template<typename T >
void TableFunctionManager::get_metadata ( const std::string &  key,
T &  value 
)
inline

Definition at line 1205 of file heavydbTypes.h.

References heavydb.dtypes::T, and TableFunctionManager_get_metadata().

Referenced by tf_metadata_getter__cpu_template(), and tf_metadata_getter_bad__cpu_template().

1205  {
1206  const uint8_t* raw_data{};
1207  size_t num_bytes{};
1208  TableFunctionMetadataType value_type;
1210  reinterpret_cast<int8_t*>(this), key.c_str(), raw_data, num_bytes, value_type);
1211  if (sizeof(T) != num_bytes) {
1212  throw std::runtime_error("Size mismatch for Table Function Metadata '" + key + "'");
1213  }
1214  if (get_metadata_type<T>() != value_type) {
1215  throw std::runtime_error("Type mismatch for Table Function Metadata '" + key + "'");
1216  }
1217  std::memcpy(&value, raw_data, num_bytes);
1218  }
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)
TableFunctionMetadataType

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t TableFunctionManager::get_ncols ( ) const
inline

Definition at line 86 of file TableFunctionManager.h.

References exe_unit_, and TableFunctionExecutionUnit::target_exprs.

Referenced by allocate_output_buffers(), set_output_array_values_total_number(), set_output_column(), and TableFunctionManager().

86 { return exe_unit_.target_exprs.size(); }
const TableFunctionExecutionUnit & exe_unit_
std::vector< Analyzer::Expr * > target_exprs

+ Here is the caller graph for this function:

size_t TableFunctionManager::get_nrows ( ) const
inline

Definition at line 89 of file TableFunctionManager.h.

References output_num_rows_.

89 { return output_num_rows_; }
static TableFunctionManager*& TableFunctionManager::get_singleton ( )
inlinestatic

Definition at line 267 of file TableFunctionManager.h.

267  {
268  static TableFunctionManager* instance = nullptr;
269  return instance;
270  }
static TableFunctionManager* TableFunctionManager::get_singleton ( )
inlinestatic

Definition at line 1171 of file heavydbTypes.h.

References TableFunctionManager_get_singleton().

Referenced by ct_sleep1__cpu_(), ct_sleep2(), set_singleton(), and sum_along_row__cpu_template().

1171  {
1172  return reinterpret_cast<TableFunctionManager*>(TableFunctionManager_get_singleton());
1173  }
EXTENSION_NOINLINE_HOST int8_t * TableFunctionManager_get_singleton()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* TableFunctionManager::getCString ( int32_t  dict_id,
int32_t  string_id 
)
inline

Definition at line 244 of file TableFunctionManager.h.

References executor_, and row_set_mem_owner_.

244  {
245  const auto proxy =
246  executor_->getStringDictionaryProxy(dict_id, row_set_mem_owner_, true);
247  auto [c_str, len] = proxy->getStringBytes(string_id);
248  return c_str;
249  }
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
const char* TableFunctionManager::getCString ( int32_t  dict_id,
int32_t  string_id 
)
inline

Definition at line 1226 of file heavydbTypes.h.

References TableFunctionManager_getCString().

1226  {
1228  reinterpret_cast<int8_t*>(this), dict_id, string_id);
1229  }
EXTENSION_NOINLINE_HOST const char * TableFunctionManager_getCString(int8_t *mgr_ptr, int32_t dict_id, int32_t string_id)

+ Here is the call graph for this function:

int32_t TableFunctionManager::getNewDictId ( )
inline

Definition at line 232 of file TableFunctionManager.h.

References executor_, row_set_mem_owner_, and TRANSIENT_DICT_ID.

232  {
233  const auto proxy =
234  executor_->getStringDictionaryProxy(TRANSIENT_DICT_ID, row_set_mem_owner_, true);
235  return proxy->getDictId();
236  }
#define TRANSIENT_DICT_ID
Definition: sqltypes.h:310
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
int32_t TableFunctionManager::getNewDictId ( )
inline

Definition at line 1219 of file heavydbTypes.h.

References TableFunctionManager_getNewDictId().

Referenced by array_asarray__cpu_template().

1219  {
1220  return TableFunctionManager_getNewDictId(reinterpret_cast<int8_t*>(this));
1221  }
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_getNewDictId(int8_t *mgr_ptr)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const int32_t TableFunctionManager::getOrAddTransient ( int32_t  dict_id,
const std::string &  str 
)
inline

Definition at line 251 of file TableFunctionManager.h.

References executor_, and row_set_mem_owner_.

251  {
252  const auto proxy =
253  executor_->getStringDictionaryProxy(dict_id, row_set_mem_owner_, true);
254  return proxy->getOrAddTransient(str);
255  }
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
int32_t TableFunctionManager::getOrAddTransient ( int32_t  dict_id,
std::string  str 
)
inline

Definition at line 1230 of file heavydbTypes.h.

References TableFunctionManager_getOrAddTransient().

Referenced by array_asarray__cpu_template().

1230  {
1232  reinterpret_cast<int8_t*>(this), dict_id, str);
1233  }
EXTENSION_NOINLINE_HOST int32_t TableFunctionManager_getOrAddTransient(int8_t *mgr_ptr, 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 TableFunctionManager::getString ( int32_t  dict_id,
int32_t  string_id 
)
inline

Definition at line 238 of file TableFunctionManager.h.

References executor_, and row_set_mem_owner_.

238  {
239  const auto proxy =
240  executor_->getStringDictionaryProxy(dict_id, row_set_mem_owner_, true);
241  return proxy->getString(string_id);
242  }
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
std::string TableFunctionManager::getString ( int32_t  dict_id,
int32_t  string_id 
)
inline

Definition at line 1222 of file heavydbTypes.h.

References TableFunctionManager_getString().

Referenced by array_asarray__cpu_template().

1222  {
1224  reinterpret_cast<int8_t*>(this), dict_id, string_id);
1225  }
std::string TableFunctionManager_getString(int8_t *mgr_ptr, int32_t dict_id, int32_t string_id)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool TableFunctionManager::isSingleton ( ) const
inline

Definition at line 259 of file TableFunctionManager.h.

References is_singleton_.

Referenced by TableFunctionManager(), and ~TableFunctionManager().

259 { return is_singleton_; }

+ Here is the caller graph for this function:

void TableFunctionManager::lock ( )
inlineprivate

Definition at line 273 of file TableFunctionManager.h.

References TableFunctionManager_singleton_mutex.

Referenced by set_singleton().

std::mutex TableFunctionManager_singleton_mutex

+ Here is the caller graph for this function:

void TableFunctionManager::set_error_message ( const char *  msg)
inline

Definition at line 211 of file TableFunctionManager.h.

References check_thread_id(), and error_message_.

211  {
212  check_thread_id();
213  error_message_ = std::string(msg);
214  }

+ Here is the call graph for this function:

void TableFunctionManager::set_metadata ( const char *  key,
const uint8_t *  raw_bytes,
const size_t  num_bytes,
const TableFunctionMetadataType  value_type 
) const
inline

Definition at line 216 of file TableFunctionManager.h.

References CHECK, and row_set_mem_owner_.

219  {
221  row_set_mem_owner_->setTableFunctionMetadata(key, raw_bytes, num_bytes, value_type);
222  }
std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner_
#define CHECK(condition)
Definition: Logger.h:289
template<typename T >
void TableFunctionManager::set_metadata ( const std::string &  key,
const T &  value 
)
inline

Definition at line 1196 of file heavydbTypes.h.

References TableFunctionManager_set_metadata().

Referenced by GeoRaster< T, Z >::setMetadata(), tf_metadata_setter__cpu_template(), tf_metadata_setter_repeated__cpu_template(), and tf_metadata_setter_size_mismatch__cpu_template().

1196  {
1197  TableFunctionManager_set_metadata(reinterpret_cast<int8_t*>(this),
1198  key.c_str(),
1199  reinterpret_cast<const uint8_t*>(&value),
1200  sizeof(value),
1201  get_metadata_type<T>());
1202  }
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)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TableFunctionManager::set_output_array_values_total_number ( int32_t  index,
int64_t  output_array_values_total_number 
)
inline

Definition at line 107 of file TableFunctionManager.h.

References CHECK_EQ, CHECK_LE, CHECK_LT, get_ncols(), output_array_values_total_number_, and output_num_rows_.

108  {
110  size_t(-1)); // set_output_array_size must be called
111  // before set_output_row_size because
112  // set_output_row_size allocates the output
113  // buffers
114  int32_t num_out_columns = get_ncols();
115  CHECK_LE(0, index);
116  CHECK_LT(index, num_out_columns);
117  output_array_values_total_number_[index] = output_array_values_total_number;
118  }
#define CHECK_EQ(x, y)
Definition: Logger.h:297
#define CHECK_LT(x, y)
Definition: Logger.h:299
#define CHECK_LE(x, y)
Definition: Logger.h:300
std::vector< int64_t > output_array_values_total_number_

+ Here is the call graph for this function:

void TableFunctionManager::set_output_array_values_total_number ( int32_t  index,
int64_t  output_array_values_total_number 
)
inline

Definition at line 1175 of file heavydbTypes.h.

References TableFunctionManager_set_output_array_values_total_number().

Referenced by array_asarray__cpu_template(), array_concat__cpu_template(), array_copier__cpu_template(), and array_split__cpu_template().

1176  {
1178  reinterpret_cast<int8_t*>(this), index, output_array_values_total_number);
1179  }
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)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TableFunctionManager::set_output_column ( int32_t  index,
int8_t *  ptr 
)
inline

Definition at line 99 of file TableFunctionManager.h.

References CHECK, check_thread_id(), get_ncols(), and output_column_ptrs.

99  {
100  check_thread_id();
101  CHECK(index >= 0 && index < static_cast<int32_t>(get_ncols()));
102  CHECK(ptr);
103  output_column_ptrs[index] = ptr;
104  }
std::vector< int8_t * > output_column_ptrs
#define CHECK(condition)
Definition: Logger.h:289

+ Here is the call graph for this function:

void TableFunctionManager::set_output_row_size ( int64_t  num_rows)
inline

Definition at line 1181 of file heavydbTypes.h.

References TableFunctionManager_set_output_row_size().

Referenced by array_asarray__cpu_template(), array_concat__cpu_template(), array_copier__cpu_template(), array_split__cpu_template(), ct_add_size_and_mul_alpha(), ct_copy_and_add_size(), ct_cursor_named_args__cpu_(), ct_pushdown_projection__cpu_template(), ct_pushdown_stats__cpu_template(), ct_scalar_named_args__cpu_(), ct_sleep2(), ct_sparse_add(), ct_string_concat__cpu_(), ct_substr__cpu_(), ct_synthesize_new_dict__cpu_(), ct_test_preflight_multicursor_qe227__cpu_(), ct_test_preflight_singlecursor_qe227__cpu_(), ct_throw_if_gt_100__cpu_template(), ct_timestamp_add_interval__template(), ct_timestamp_add_offset(), ct_timestamp_column_list_input(), ct_timestamp_extract(), ct_timestamp_truncate(), ct_union_pushdown_projection__cpu_template(), ct_union_pushdown_stats__cpu_template(), dbscan__cpu_template(), generate_random_strings__cpu_(), generate_series__cpu_template(), kmeans__cpu_template(), linear_reg_fit__cpu_template(), linear_reg_predict__cpu_template(), Mandelbrot::mandelbrot_cpu_template(), GeoRaster< T, Z >::outputDenseColumns(), supported_ml_frameworks__cpu_(), tf_metadata_getter__cpu_template(), tf_metadata_getter_bad__cpu_template(), tf_metadata_setter__cpu_template(), tf_metadata_setter_repeated__cpu_template(), and tf_metadata_setter_size_mismatch__cpu_template().

1181  {
1182  if (!output_allocations_disabled) {
1183  TableFunctionManager_set_output_row_size(reinterpret_cast<int8_t*>(this), num_rows);
1184  }
1185  }
EXTENSION_NOINLINE_HOST void TableFunctionManager_set_output_row_size(int8_t *mgr_ptr, int64_t num_rows)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void TableFunctionManager::set_singleton ( TableFunctionManager instance)
inlinestaticprivate

Definition at line 276 of file TableFunctionManager.h.

References CHECK, get_singleton(), and lock().

Referenced by TableFunctionManager(), and ~TableFunctionManager().

276  {
277  auto& instance_ = get_singleton();
278  // ensure being singleton and lock/unlock
279  if (instance) {
280  instance->lock();
281  CHECK(instance_ == nullptr);
282  } else {
283  CHECK(instance_ != nullptr);
284  instance_->unlock();
285  }
286  instance_ = instance;
287  }
#define CHECK(condition)
Definition: Logger.h:289
static TableFunctionManager * get_singleton()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string TableFunctionManager::toString ( ) const
inline

Definition at line 1236 of file heavydbTypes.h.

References run_benchmark_import::result, and typeName().

Referenced by allocate_output_buffers().

1236  {
1237  std::string result = ::typeName(this) + "(";
1238  if (!(void*)this) { // cast to void* to avoid warnings
1239  result += "UNINITIALIZED";
1240  }
1241  result += ")";
1242  return result;
1243  }
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TableFunctionManager::unlock ( )
inlineprivate

Definition at line 274 of file TableFunctionManager.h.

References TableFunctionManager_singleton_mutex.

std::mutex TableFunctionManager_singleton_mutex

Member Data Documentation

std::vector<const int8_t*>& TableFunctionManager::col_buf_ptrs_
private

Definition at line 292 of file TableFunctionManager.h.

Referenced by allocate_output_buffers().

std::string TableFunctionManager::error_message_
private

Definition at line 308 of file TableFunctionManager.h.

Referenced by get_error_message(), and set_error_message().

const TableFunctionExecutionUnit& TableFunctionManager::exe_unit_
private

Definition at line 289 of file TableFunctionManager.h.

Referenced by allocate_output_buffers(), and get_ncols().

Executor* TableFunctionManager::executor_
private
bool output_allocations_disabled TableFunctionManager::false

Definition at line 1245 of file heavydbTypes.h.

bool TableFunctionManager::is_singleton_
private

Definition at line 304 of file TableFunctionManager.h.

Referenced by isSingleton().

std::vector<int64_t> TableFunctionManager::output_array_values_total_number_
private
std::vector<int64_t*> TableFunctionManager::output_col_buf_ptrs
private

Definition at line 296 of file TableFunctionManager.h.

Referenced by allocate_output_buffers(), and TableFunctionManager().

std::vector<int8_t*> TableFunctionManager::output_column_ptrs
private
size_t TableFunctionManager::output_num_rows_
private
std::unique_ptr<QueryMemoryInitializer> TableFunctionManager::query_buffers

Definition at line 57 of file TableFunctionManager.h.

Referenced by allocate_output_buffers().

std::shared_ptr<RowSetMemoryOwner> TableFunctionManager::row_set_mem_owner_
private
std::thread::id TableFunctionManager::thread_id_
private

Definition at line 306 of file TableFunctionManager.h.

Referenced by check_thread_id().


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