OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrowResultSet.h File Reference
#include "CompilationOptions.h"
#include "DataMgr/DataMgr.h"
#include "Descriptors/RelAlgExecutionDescriptor.h"
#include "ResultSet.h"
#include "TargetMetaInfo.h"
#include "TargetValue.h"
#include <type_traits>
#include "arrow/api.h"
#include "arrow/ipc/api.h"
+ Include dependency graph for ArrowResultSet.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ArrowResultSetRowIterator
 
struct  ArrowResult
 
class  ArrowResultSet
 
class  ArrowResultSetConverter
 
struct  ArrowResultSetConverter::ColumnBuilder
 
struct  ArrowResultSetConverter::SerializedArrowOutput
 

Typedefs

using ValueArray = boost::variant< std::vector< bool >, std::vector< int8_t >, std::vector< int16_t >, std::vector< int32_t >, std::vector< int64_t >, std::vector< arrow::Decimal128 >, std::vector< float >, std::vector< double >, std::vector< std::string >, std::vector< std::vector< int8_t >>, std::vector< std::vector< int16_t >>, std::vector< std::vector< int32_t >>, std::vector< std::vector< int64_t >>, std::vector< std::vector< float >>, std::vector< std::vector< double >>, std::vector< std::vector< std::string >>>
 
template<typename T >
using Vec2 = std::vector< std::vector< T >>
 

Enumerations

enum  ArrowTransport { ArrowTransport::SHARED_MEMORY = 0, ArrowTransport::WIRE = 1 }
 
enum  ArrowStringRemapMode { ArrowStringRemapMode::ALL_STRINGS_REMAPPED, ArrowStringRemapMode::ONLY_TRANSIENT_STRINGS_REMAPPED, ArrowStringRemapMode::INVALID }
 

Functions

std::unique_ptr< ArrowResultSetresult_set_arrow_loopback (const ExecutionResult &results)
 
std::unique_ptr< ArrowResultSetresult_set_arrow_loopback (const ExecutionResult *results, const std::shared_ptr< ResultSet > &rows, const ExecutorDeviceType device_type=ExecutorDeviceType::CPU)
 
std::unique_ptr< ArrowResultSetresult_set_arrow_loopback (const ExecutionResult *results, const std::shared_ptr< ResultSet > &rows, const ExecutorDeviceType device_type, const size_t min_result_size_for_bulk_dictionary_fetch, const double max_dictionary_to_result_size_ratio_for_bulk_dictionary_fetch)
 
template<typename T >
constexpr auto scale_epoch_values ()
 

Typedef Documentation

using ValueArray = boost::variant<std::vector<bool>, std::vector<int8_t>, std::vector<int16_t>, std::vector<int32_t>, std::vector<int64_t>, std::vector<arrow::Decimal128>, std::vector<float>, std::vector<double>, std::vector<std::string>, std::vector<std::vector<int8_t>>, std::vector<std::vector<int16_t>>, std::vector<std::vector<int32_t>>, std::vector<std::vector<int64_t>>, std::vector<std::vector<float>>, std::vector<std::vector<double>>, std::vector<std::vector<std::string>>>

Definition at line 52 of file ArrowResultSet.h.

template<typename T >
using Vec2 = std::vector<std::vector<T>>

Definition at line 55 of file ArrowResultSet.h.

Enumeration Type Documentation

enum ArrowStringRemapMode
strong
Enumerator
ALL_STRINGS_REMAPPED 
ONLY_TRANSIENT_STRINGS_REMAPPED 
INVALID 

Definition at line 222 of file ArrowResultSet.h.

enum ArrowTransport
strong
Enumerator
SHARED_MEMORY 
WIRE 

Definition at line 95 of file ArrowResultSet.h.

Function Documentation

std::unique_ptr<ArrowResultSet> result_set_arrow_loopback ( const ExecutionResult results)

Definition at line 328 of file ArrowResultSet.cpp.

References ExecutionResult::getRows(), and ExecutionResult::getTargetsMeta().

329  {
330  // NOTE(wesm): About memory ownership
331 
332  // After calling ReadRecordBatch, the buffers inside arrow::RecordBatch now
333  // share ownership of the memory in serialized_arrow_output.records (zero
334  // copy). Not necessary to retain these buffers. Same is true of any
335  // dictionaries contained in serialized_arrow_output.schema; the arrays
336  // reference that memory (zero copy).
337  return std::make_unique<ArrowResultSet>(results.getRows(), results.getTargetsMeta());
338 }
const std::vector< TargetMetaInfo > & getTargetsMeta() const
const std::shared_ptr< ResultSet > & getRows() const

+ Here is the call graph for this function:

std::unique_ptr<ArrowResultSet> result_set_arrow_loopback ( const ExecutionResult results,
const std::shared_ptr< ResultSet > &  rows,
const ExecutorDeviceType  device_type = ExecutorDeviceType::CPU 
)

Definition at line 340 of file ArrowResultSet.cpp.

References ExecutionResult::getTargetsMeta().

343  {
344  return results ? std::make_unique<ArrowResultSet>(
345  rows, results->getTargetsMeta(), device_type)
346  : std::make_unique<ArrowResultSet>(rows, device_type);
347 }
const std::vector< TargetMetaInfo > & getTargetsMeta() const

+ Here is the call graph for this function:

std::unique_ptr<ArrowResultSet> result_set_arrow_loopback ( const ExecutionResult results,
const std::shared_ptr< ResultSet > &  rows,
const ExecutorDeviceType  device_type,
const size_t  min_result_size_for_bulk_dictionary_fetch,
const double  max_dictionary_to_result_size_ratio_for_bulk_dictionary_fetch 
)

Definition at line 349 of file ArrowResultSet.cpp.

References ExecutionResult::getTargetsMeta().

354  {
355  std::vector<TargetMetaInfo> dummy_targets_meta;
356  return results ? std::make_unique<ArrowResultSet>(
357  rows,
358  results->getTargetsMeta(),
359  device_type,
360  min_result_size_for_bulk_dictionary_fetch,
361  max_dictionary_to_result_size_ratio_for_bulk_dictionary_fetch)
362  : std::make_unique<ArrowResultSet>(
363  rows,
364  dummy_targets_meta,
365  device_type,
366  min_result_size_for_bulk_dictionary_fetch,
367  max_dictionary_to_result_size_ratio_for_bulk_dictionary_fetch);
368 }
const std::vector< TargetMetaInfo > & getTargetsMeta() const

+ Here is the call graph for this function:

template<typename T >
constexpr auto scale_epoch_values ( )

Definition at line 360 of file ArrowResultSet.h.

360  {
361  return std::is_same<T, arrow::Date32Builder>::value ||
362  std::is_same<T, arrow::Date64Builder>::value;
363 }