OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{TableOptimizer.cpp} Namespace Reference

Functions

template<typename T >
read_scalar_target_value (const TargetValue &tv)
 
bool set_metadata_from_results (ChunkMetadata &chunk_metadata, const std::vector< TargetValue > &row, const SQLTypeInfo &ti, const bool has_nulls)
 
RelAlgExecutionUnit build_ra_exe_unit (const std::shared_ptr< const InputColDescriptor > input_col_desc, const std::vector< Analyzer::Expr * > &target_exprs)
 
CompilationOptions get_compilation_options (const ExecutorDeviceType &device_type)
 
ExecutionOptions get_execution_options ()
 

Function Documentation

RelAlgExecutionUnit anonymous_namespace{TableOptimizer.cpp}::build_ra_exe_unit ( const std::shared_ptr< const InputColDescriptor input_col_desc,
const std::vector< Analyzer::Expr * > &  target_exprs 
)

Definition at line 94 of file TableOptimizer.cpp.

References Default.

Referenced by TableOptimizer::getDeletedColumnStats(), and TableOptimizer::recomputeColumnMetadata().

96  {
97  return RelAlgExecutionUnit{{input_col_desc->getScanDesc()},
98  {input_col_desc},
99  {},
100  {},
101  {},
102  {},
103  target_exprs,
104  nullptr,
105  SortInfo{{}, SortAlgorithm::Default, 0, 0},
106  0};
107 }

+ Here is the caller graph for this function:

CompilationOptions anonymous_namespace{TableOptimizer.cpp}::get_compilation_options ( const ExecutorDeviceType device_type)
inline

Definition at line 109 of file TableOptimizer.cpp.

References Default.

Referenced by TableOptimizer::getDeletedColumnStats(), and TableOptimizer::recomputeColumnMetadata().

109  {
110  return CompilationOptions{device_type, false, ExecutorOptLevel::Default, false};
111 }

+ Here is the caller graph for this function:

ExecutionOptions anonymous_namespace{TableOptimizer.cpp}::get_execution_options ( )
inline

Definition at line 113 of file TableOptimizer.cpp.

Referenced by TableOptimizer::getDeletedColumnStats(), and TableOptimizer::recomputeColumnMetadata().

113  {
114  return ExecutionOptions{
115  false, false, false, false, false, false, false, false, 0, false, false, 0, false};
116 }

+ Here is the caller graph for this function:

template<typename T >
T anonymous_namespace{TableOptimizer.cpp}::read_scalar_target_value ( const TargetValue tv)

Definition at line 38 of file TableOptimizer.cpp.

References CHECK.

38  {
39  const auto stv = boost::get<ScalarTargetValue>(&tv);
40  CHECK(stv);
41  const auto val_ptr = boost::get<T>(stv);
42  CHECK(val_ptr);
43  return *val_ptr;
44 }
#define CHECK(condition)
Definition: Logger.h:203
bool anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results ( ChunkMetadata chunk_metadata,
const std::vector< TargetValue > &  row,
const SQLTypeInfo ti,
const bool  has_nulls 
)

Definition at line 46 of file TableOptimizer.cpp.

References ChunkMetadata::fillChunkStats(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, and kVARCHAR.

Referenced by TableOptimizer::getDeletedColumnStats(), and TableOptimizer::recomputeColumnMetadata().

49  {
50  switch (ti.get_type()) {
51  case kBOOLEAN:
52  case kTINYINT:
53  case kSMALLINT:
54  case kINT:
55  case kBIGINT:
56  case kNUMERIC:
57  case kDECIMAL:
58  case kTIME:
59  case kTIMESTAMP:
60  case kDATE: {
61  int64_t min_val = read_scalar_target_value<int64_t>(row[0]);
62  int64_t max_val = read_scalar_target_value<int64_t>(row[1]);
63  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
64  break;
65  }
66  case kFLOAT: {
67  float min_val = read_scalar_target_value<float>(row[0]);
68  float max_val = read_scalar_target_value<float>(row[1]);
69  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
70  break;
71  }
72  case kDOUBLE: {
73  double min_val = read_scalar_target_value<double>(row[0]);
74  double max_val = read_scalar_target_value<double>(row[1]);
75  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
76  break;
77  }
78  case kVARCHAR:
79  case kCHAR:
80  case kTEXT:
81  if (ti.get_compression() == kENCODING_DICT) {
82  int64_t min_val = read_scalar_target_value<int64_t>(row[0]);
83  int64_t max_val = read_scalar_target_value<int64_t>(row[1]);
84  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
85  }
86  break;
87  default: {
88  return false; // skip column
89  }
90  }
91  return true;
92 }
Definition: sqltypes.h:48
void fillChunkStats(const T min, const T max, const bool has_nulls)
Definition: ChunkMetadata.h:73
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:314
Definition: sqltypes.h:51
Definition: sqltypes.h:52
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:322
Definition: sqltypes.h:40
Definition: sqltypes.h:44

+ Here is the call graph for this function:

+ Here is the caller graph for this function: