OmniSciDB  04ee39c94c
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

◆ build_ra_exe_unit()

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 81 of file TableOptimizer.cpp.

References Default.

Referenced by TableOptimizer::recomputeMetadata().

83  {
84  return RelAlgExecutionUnit{{input_col_desc->getScanDesc()},
85  {input_col_desc},
86  {},
87  {},
88  {},
89  {},
90  target_exprs,
91  nullptr,
93  0};
94 }
+ Here is the caller graph for this function:

◆ get_compilation_options()

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

Definition at line 96 of file TableOptimizer.cpp.

References Default.

Referenced by TableOptimizer::recomputeMetadata().

+ Here is the caller graph for this function:

◆ get_execution_options()

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

Definition at line 100 of file TableOptimizer.cpp.

Referenced by TableOptimizer::recomputeMetadata().

100  {
101  return ExecutionOptions{
102  false, false, false, false, false, false, false, false, 0, false, false, 0};
103 }
+ Here is the caller graph for this function:

◆ read_scalar_target_value()

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

Definition at line 25 of file TableOptimizer.cpp.

References CHECK.

25  {
26  const auto stv = boost::get<ScalarTargetValue>(&tv);
27  CHECK(stv);
28  const auto val_ptr = boost::get<T>(stv);
29  CHECK(val_ptr);
30  return *val_ptr;
31 }
#define CHECK(condition)
Definition: Logger.h:187

◆ set_metadata_from_results()

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 33 of file TableOptimizer.cpp.

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

Referenced by TableOptimizer::recomputeMetadata().

36  {
37  switch (ti.get_type()) {
38  case kBOOLEAN:
39  case kTINYINT:
40  case kSMALLINT:
41  case kINT:
42  case kBIGINT:
43  case kNUMERIC:
44  case kDECIMAL:
45  case kTIME:
46  case kTIMESTAMP:
47  case kDATE: {
48  int64_t min_val = read_scalar_target_value<int64_t>(row[0]);
49  int64_t max_val = read_scalar_target_value<int64_t>(row[1]);
50  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
51  break;
52  }
53  case kFLOAT: {
54  float min_val = read_scalar_target_value<float>(row[0]);
55  float max_val = read_scalar_target_value<float>(row[1]);
56  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
57  break;
58  }
59  case kDOUBLE: {
60  double min_val = read_scalar_target_value<double>(row[0]);
61  double max_val = read_scalar_target_value<double>(row[1]);
62  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
63  break;
64  }
65  case kVARCHAR:
66  case kCHAR:
67  case kTEXT:
68  if (ti.get_compression() == kENCODING_DICT) {
69  int64_t min_val = read_scalar_target_value<int64_t>(row[0]);
70  int64_t max_val = read_scalar_target_value<int64_t>(row[1]);
71  chunk_metadata.fillChunkStats(min_val, max_val, has_nulls);
72  }
73  break;
74  default: {
75  return false; // skip column
76  }
77  }
78  return true;
79 }
Definition: sqltypes.h:51
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
void fillChunkStats(const T min, const T max, const bool has_nulls)
Definition: ChunkMetadata.h:38
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
Definition: sqltypes.h:54
Definition: sqltypes.h:55
Definition: sqltypes.h:43
Definition: sqltypes.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function: