OmniSciDB  a47db9e897
 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 89 of file TableOptimizer.cpp.

References Default.

Referenced by TableOptimizer::recomputeMetadata().

91  {
92  return RelAlgExecutionUnit{{input_col_desc->getScanDesc()},
93  {input_col_desc},
94  {},
95  {},
96  {},
97  {},
98  target_exprs,
99  nullptr,
100  SortInfo{{}, SortAlgorithm::Default, 0, 0},
101  0};
102 }

+ Here is the caller graph for this function:

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

Definition at line 104 of file TableOptimizer.cpp.

References Default.

Referenced by TableOptimizer::recomputeMetadata().

104  {
105  return CompilationOptions{device_type, false, ExecutorOptLevel::Default, false};
106 }

+ Here is the caller graph for this function:

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

Definition at line 108 of file TableOptimizer.cpp.

Referenced by TableOptimizer::recomputeMetadata().

108  {
109  return ExecutionOptions{
110  false, false, false, false, false, false, false, false, 0, false, false, 0};
111 }

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

References CHECK().

33  {
34  const auto stv = boost::get<ScalarTargetValue>(&tv);
35  CHECK(stv);
36  const auto val_ptr = boost::get<T>(stv);
37  CHECK(val_ptr);
38  return *val_ptr;
39 }
CHECK(cgen_state)

+ Here is the call graph for this function:

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 41 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().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function: