OmniSciDB  5ade3759e0
ExpressionRange.h File Reference
#include "../Analyzer/Analyzer.h"
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/optional.hpp>
+ Include dependency graph for ExpressionRange.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ExpressionRange
 

Typedefs

typedef boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 64, 64, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void > > checked_int64_t
 

Enumerations

enum  ExpressionRangeType {
  ExpressionRangeType::Invalid, ExpressionRangeType::Integer, ExpressionRangeType::Float, ExpressionRangeType::Double,
  ExpressionRangeType::Null
}
 

Functions

template<typename T >
getMin (const ExpressionRange &other)
 
template<typename T >
getMax (const ExpressionRange &other)
 
template<typename T >
get_value_from_datum (const Datum datum, const SQLTypes type_info) noexcept
 
template<>
int64_t getMin< int64_t > (const ExpressionRange &e)
 
template<>
float getMin< float > (const ExpressionRange &e)
 
template<>
double getMin< double > (const ExpressionRange &e)
 
template<>
int64_t getMax< int64_t > (const ExpressionRange &e)
 
template<>
float getMax< float > (const ExpressionRange &e)
 
template<>
double getMax< double > (const ExpressionRange &e)
 
template<>
int64_t get_value_from_datum (const Datum datum, const SQLTypes type_info) noexcept
 
template<>
double get_value_from_datum (const Datum datum, const SQLTypes type_info) noexcept
 
void apply_int_qual (const Datum const_datum, const SQLTypes const_type, const SQLOps sql_op, ExpressionRange &qual_range)
 
void apply_fp_qual (const Datum const_datum, const SQLTypes const_type, const SQLOps sql_op, ExpressionRange &qual_range)
 
void apply_hpt_qual (const Datum const_datum, const SQLTypes const_type, const int32_t const_dimen, const int32_t col_dimen, const SQLOps sql_op, ExpressionRange &qual_range)
 
ExpressionRange apply_simple_quals (const Analyzer::ColumnVar *, const ExpressionRange &, const boost::optional< std::list< std::shared_ptr< Analyzer::Expr >>>=boost::none)
 
ExpressionRange getLeafColumnRange (const Analyzer::ColumnVar *, const std::vector< InputTableInfo > &, const Executor *, const bool is_outer_join_proj)
 
ExpressionRange getExpressionRange (const Analyzer::Expr *, const std::vector< InputTableInfo > &, const Executor *, boost::optional< std::list< std::shared_ptr< Analyzer::Expr >>>=boost::none)
 

Typedef Documentation

◆ checked_int64_t

typedef boost::multiprecision::number< boost::multiprecision::cpp_int_backend<64, 64, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void> > checked_int64_t

Definition at line 30 of file ExpressionRange.h.

Enumeration Type Documentation

◆ ExpressionRangeType

Function Documentation

◆ apply_fp_qual()

void apply_fp_qual ( const Datum  const_datum,
const SQLTypes  const_type,
const SQLOps  sql_op,
ExpressionRange qual_range 
)

Definition at line 73 of file ExpressionRange.cpp.

References kEQ, kGE, kGT, kLE, and kLT.

Referenced by apply_simple_quals(), and get_value_from_datum().

76  {
77  double const_val = get_value_from_datum<double>(const_datum, const_type);
78  switch (sql_op) {
79  case kGT:
80  case kGE:
81  qual_range.setFpMin(std::max(qual_range.getFpMin(), const_val));
82  break;
83  case kLT:
84  case kLE:
85  qual_range.setFpMax(std::min(qual_range.getFpMax(), const_val));
86  break;
87  case kEQ:
88  qual_range.setFpMin(std::max(qual_range.getFpMin(), const_val));
89  qual_range.setFpMax(std::min(qual_range.getFpMax(), const_val));
90  break;
91  default: // there may be other operators, but don't do anything with them
92  break;
93  }
94 }
Definition: sqldefs.h:35
Definition: sqldefs.h:36
double getFpMin() const
Definition: sqldefs.h:30
Definition: sqldefs.h:34
void setFpMax(const double fp_max)
double getFpMax() const
Definition: sqldefs.h:33
void setFpMin(const double fp_min)
+ Here is the caller graph for this function:

◆ apply_hpt_qual()

void apply_hpt_qual ( const Datum  const_datum,
const SQLTypes  const_type,
const int32_t  const_dimen,
const int32_t  col_dimen,
const SQLOps  sql_op,
ExpressionRange qual_range 
)

Definition at line 123 of file ExpressionRange.cpp.

References apply_int_qual(), Datum::bigintval, CHECK, and DateTimeUtils::get_timestamp_precision_scale().

Referenced by apply_simple_quals(), and get_value_from_datum().

128  {
129  CHECK(const_dimen != col_dimen);
130  Datum datum{0};
131  if (const_dimen > col_dimen) {
132  datum.bigintval =
133  get_value_from_datum<int64_t>(const_datum, const_type) /
134  DateTimeUtils::get_timestamp_precision_scale(const_dimen - col_dimen);
135  } else {
136  datum.bigintval =
137  get_value_from_datum<int64_t>(const_datum, const_type) *
138  DateTimeUtils::get_timestamp_precision_scale(col_dimen - const_dimen);
139  }
140  apply_int_qual(datum, const_type, sql_op, qual_range);
141 }
void apply_int_qual(const Datum const_datum, const SQLTypes const_type, const SQLOps sql_op, ExpressionRange &qual_range)
int64_t bigintval
Definition: sqltypes.h:126
#define CHECK(condition)
Definition: Logger.h:187
constexpr int64_t get_timestamp_precision_scale(const int32_t dimen)
Definition: DateTimeUtils.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_int_qual()

void apply_int_qual ( const Datum  const_datum,
const SQLTypes  const_type,
const SQLOps  sql_op,
ExpressionRange qual_range 
)

Definition at line 96 of file ExpressionRange.cpp.

References ExpressionRange::getIntMax(), ExpressionRange::getIntMin(), kEQ, kGE, kGT, kLE, kLT, ExpressionRange::setIntMax(), and ExpressionRange::setIntMin().

Referenced by apply_hpt_qual(), apply_simple_quals(), and get_value_from_datum().

99  {
100  int64_t const_val = get_value_from_datum<int64_t>(const_datum, const_type);
101  switch (sql_op) {
102  case kGT:
103  qual_range.setIntMin(std::max(qual_range.getIntMin(), const_val + 1));
104  break;
105  case kGE:
106  qual_range.setIntMin(std::max(qual_range.getIntMin(), const_val));
107  break;
108  case kLT:
109  qual_range.setIntMax(std::min(qual_range.getIntMax(), const_val - 1));
110  break;
111  case kLE:
112  qual_range.setIntMax(std::min(qual_range.getIntMax(), const_val));
113  break;
114  case kEQ:
115  qual_range.setIntMin(std::max(qual_range.getIntMin(), const_val));
116  qual_range.setIntMax(std::min(qual_range.getIntMax(), const_val));
117  break;
118  default: // there may be other operators, but don't do anything with them
119  break;
120  }
121 }
Definition: sqldefs.h:35
Definition: sqldefs.h:36
Definition: sqldefs.h:30
void setIntMin(const int64_t int_min)
int64_t getIntMax() const
int64_t getIntMin() const
Definition: sqldefs.h:34
void setIntMax(const int64_t int_max)
Definition: sqldefs.h:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_simple_quals()

ExpressionRange apply_simple_quals ( const Analyzer::ColumnVar ,
const ExpressionRange ,
const boost::optional< std::list< std::shared_ptr< Analyzer::Expr >>>  = boost::none 
)

Definition at line 143 of file ExpressionRange.cpp.

References apply_fp_qual(), apply_hpt_qual(), apply_int_qual(), Double, Float, Analyzer::ColumnVar::get_column_id(), Analyzer::ColumnVar::get_table_id(), ExpressionRange::getIntMax(), ExpressionRange::getIntMin(), ExpressionRange::getType(), ExpressionRange::hasNulls(), Integer, and ExpressionRange::makeIntRange().

Referenced by get_value_from_datum(), and getExpressionRange().

146  {
147  if (!simple_quals) {
148  return col_range;
149  }
150  ExpressionRange qual_range(col_range);
151  for (auto const& itr : simple_quals.get()) {
152  auto qual_bin_oper = dynamic_cast<Analyzer::BinOper*>(itr.get());
153  if (!qual_bin_oper) {
154  continue;
155  }
156  const Analyzer::Expr* left_operand = qual_bin_oper->get_left_operand();
157  auto qual_col = dynamic_cast<const Analyzer::ColumnVar*>(left_operand);
158  if (!qual_col) {
159  // Check for possibility that column is wrapped in a cast
160  // Presumes that only simple casts (i.e. timestamp to timestamp or int to int) have
161  // been passed through by BinOper::normalize_simple_predicate
162  auto u_expr = dynamic_cast<const Analyzer::UOper*>(left_operand);
163  if (!u_expr) {
164  continue;
165  }
166  qual_col = dynamic_cast<const Analyzer::ColumnVar*>(u_expr->get_operand());
167  if (!qual_col) {
168  continue;
169  }
170  }
171  if (qual_col->get_table_id() != col_expr->get_table_id() ||
172  qual_col->get_column_id() != col_expr->get_column_id()) {
173  continue;
174  }
175  const Analyzer::Expr* right_operand = qual_bin_oper->get_right_operand();
176  auto qual_const = dynamic_cast<const Analyzer::Constant*>(right_operand);
177  if (!qual_const) {
178  continue;
179  }
180  if (qual_range.getType() == ExpressionRangeType::Float ||
181  qual_range.getType() == ExpressionRangeType::Double) {
182  apply_fp_qual(qual_const->get_constval(),
183  qual_const->get_type_info().get_type(),
184  qual_bin_oper->get_optype(),
185  qual_range);
186  } else if ((qual_col->get_type_info().is_timestamp() ||
187  qual_const->get_type_info().is_timestamp()) &&
188  (qual_col->get_type_info().get_dimension() !=
189  qual_const->get_type_info().get_dimension())) {
190  apply_hpt_qual(qual_const->get_constval(),
191  qual_const->get_type_info().get_type(),
192  qual_const->get_type_info().get_dimension(),
193  qual_col->get_type_info().get_dimension(),
194  qual_bin_oper->get_optype(),
195  qual_range);
196  } else {
197  apply_int_qual(qual_const->get_constval(),
198  qual_const->get_type_info().get_type(),
199  qual_bin_oper->get_optype(),
200  qual_range);
201  }
202  }
203  if (qual_range.getType() == ExpressionRangeType::Integer) {
204  if (qual_range.getIntMin() > qual_range.getIntMax()) {
205  return ExpressionRange::makeIntRange(0, -1, 0, qual_range.hasNulls());
206  }
207  }
208  return qual_range;
209 }
void apply_hpt_qual(const Datum const_datum, const SQLTypes const_type, const int32_t const_dimen, const int32_t col_dimen, const SQLOps sql_op, ExpressionRange &qual_range)
void apply_int_qual(const Datum const_datum, const SQLTypes const_type, const SQLOps sql_op, ExpressionRange &qual_range)
void apply_fp_qual(const Datum const_datum, const SQLTypes const_type, const SQLOps sql_op, ExpressionRange &qual_range)
static ExpressionRange makeIntRange(const int64_t int_min, const int64_t int_max, const int64_t bucket, const bool has_nulls)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_value_from_datum() [1/3]

template<typename T >
T get_value_from_datum ( const Datum  datum,
const SQLTypes  type_info 
)
inlinenoexcept

Definition at line 249 of file ExpressionRange.h.

References apply_fp_qual(), apply_hpt_qual(), apply_int_qual(), apply_simple_quals(), Datum::bigintval, Datum::boolval, Datum::doubleval, Datum::floatval, getExpressionRange(), getLeafColumnRange(), Datum::intval, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, run-benchmark-import::optional, Datum::smallintval, Datum::tinyintval, and UNREACHABLE.

250  {
251  switch (type_info) {
252  case kBOOLEAN:
253  return datum.boolval;
254  case kTINYINT:
255  return datum.tinyintval;
256  case kSMALLINT:
257  return datum.smallintval;
258  case kINT:
259  return datum.intval;
260  case kBIGINT:
261  return datum.bigintval;
262  case kTIME:
263  case kTIMESTAMP:
264  case kDATE:
265  return datum.bigintval;
266  case kNUMERIC:
267  case kDECIMAL: {
268  return datum.bigintval;
269  break;
270  }
271  default:
272  UNREACHABLE();
273  }
274  return (int64_t)0;
275 }
int8_t tinyintval
Definition: sqltypes.h:123
Definition: sqltypes.h:51
bool boolval
Definition: sqltypes.h:122
#define UNREACHABLE()
Definition: Logger.h:231
int32_t intval
Definition: sqltypes.h:125
int64_t bigintval
Definition: sqltypes.h:126
int16_t smallintval
Definition: sqltypes.h:124
Definition: sqltypes.h:55
Definition: sqltypes.h:47
+ Here is the call graph for this function:

◆ get_value_from_datum() [2/3]

template<>
int64_t get_value_from_datum ( const Datum  datum,
const SQLTypes  type_info 
)
inlinenoexcept

Definition at line 249 of file ExpressionRange.h.

References Datum::bigintval, Datum::boolval, Datum::intval, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kINT, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, Datum::smallintval, Datum::tinyintval, and UNREACHABLE.

250  {
251  switch (type_info) {
252  case kBOOLEAN:
253  return datum.boolval;
254  case kTINYINT:
255  return datum.tinyintval;
256  case kSMALLINT:
257  return datum.smallintval;
258  case kINT:
259  return datum.intval;
260  case kBIGINT:
261  return datum.bigintval;
262  case kTIME:
263  case kTIMESTAMP:
264  case kDATE:
265  return datum.bigintval;
266  case kNUMERIC:
267  case kDECIMAL: {
268  return datum.bigintval;
269  break;
270  }
271  default:
272  UNREACHABLE();
273  }
274  return (int64_t)0;
275 }
int8_t tinyintval
Definition: sqltypes.h:123
Definition: sqltypes.h:51
bool boolval
Definition: sqltypes.h:122
#define UNREACHABLE()
Definition: Logger.h:231
int32_t intval
Definition: sqltypes.h:125
int64_t bigintval
Definition: sqltypes.h:126
int16_t smallintval
Definition: sqltypes.h:124
Definition: sqltypes.h:55
Definition: sqltypes.h:47

◆ get_value_from_datum() [3/3]

template<>
double get_value_from_datum ( const Datum  datum,
const SQLTypes  type_info 
)
inlinenoexcept

Definition at line 278 of file ExpressionRange.h.

References apply_fp_qual(), apply_hpt_qual(), apply_int_qual(), apply_simple_quals(), Datum::doubleval, Datum::floatval, getExpressionRange(), getLeafColumnRange(), kDOUBLE, kFLOAT, run-benchmark-import::optional, and UNREACHABLE.

278  {
279  switch (type_info) {
280  case kFLOAT:
281  return datum.floatval;
282  case kDOUBLE:
283  return datum.doubleval;
284  default:
285  UNREACHABLE();
286  }
287  return 0.0;
288 }
#define UNREACHABLE()
Definition: Logger.h:231
float floatval
Definition: sqltypes.h:127
double doubleval
Definition: sqltypes.h:128
+ Here is the call graph for this function:

◆ getExpressionRange()

ExpressionRange getExpressionRange ( const Analyzer::Expr ,
const std::vector< InputTableInfo > &  ,
const Executor ,
boost::optional< std::list< std::shared_ptr< Analyzer::Expr >>>  = boost::none 
)

Definition at line 321 of file ExpressionRange.cpp.

References getExpressionRange(), and ExpressionRange::makeInvalidRange().

Referenced by get_value_from_datum().

325  {
326  auto bin_oper_expr = dynamic_cast<const Analyzer::BinOper*>(expr);
327  if (bin_oper_expr) {
328  return getExpressionRange(bin_oper_expr, query_infos, executor, simple_quals);
329  }
330  auto constant_expr = dynamic_cast<const Analyzer::Constant*>(expr);
331  if (constant_expr) {
332  return getExpressionRange(constant_expr);
333  }
334  auto column_var_expr = dynamic_cast<const Analyzer::ColumnVar*>(expr);
335  if (column_var_expr) {
336  return getExpressionRange(column_var_expr, query_infos, executor, simple_quals);
337  }
338  auto like_expr = dynamic_cast<const Analyzer::LikeExpr*>(expr);
339  if (like_expr) {
340  return getExpressionRange(like_expr);
341  }
342  auto case_expr = dynamic_cast<const Analyzer::CaseExpr*>(expr);
343  if (case_expr) {
344  return getExpressionRange(case_expr, query_infos, executor);
345  }
346  auto u_expr = dynamic_cast<const Analyzer::UOper*>(expr);
347  if (u_expr) {
348  return getExpressionRange(u_expr, query_infos, executor, simple_quals);
349  }
350  auto extract_expr = dynamic_cast<const Analyzer::ExtractExpr*>(expr);
351  if (extract_expr) {
352  return getExpressionRange(extract_expr, query_infos, executor, simple_quals);
353  }
354  auto datetrunc_expr = dynamic_cast<const Analyzer::DatetruncExpr*>(expr);
355  if (datetrunc_expr) {
356  return getExpressionRange(datetrunc_expr, query_infos, executor, simple_quals);
357  }
359 }
ExpressionRange getExpressionRange(const Analyzer::BinOper *expr, const std::vector< InputTableInfo > &query_infos, const Executor *, boost::optional< std::list< std::shared_ptr< Analyzer::Expr >>> simple_quals)
static ExpressionRange makeInvalidRange()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLeafColumnRange()

ExpressionRange getLeafColumnRange ( const Analyzer::ColumnVar ,
const std::vector< InputTableInfo > &  ,
const Executor ,
const bool  is_outer_join_proj 
)

Definition at line 521 of file ExpressionRange.cpp.

References CHECK, CHECK_EQ, CHECK_GT, CHECK_NE, dtDAY, extract_max_stat(), anonymous_namespace{ExpressionRange.cpp}::extract_max_stat_double(), extract_min_stat(), anonymous_namespace{ExpressionRange.cpp}::extract_min_stat_double(), FIND_STAT_FRAG, Analyzer::ColumnVar::get_column_id(), anonymous_namespace{ExpressionRange.cpp}::get_conservative_datetrunc_bucket(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_elem_type(), get_logical_type_info(), Analyzer::ColumnVar::get_table_id(), Analyzer::Expr::get_type_info(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_array(), kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, ExpressionRange::makeDoubleRange(), ExpressionRange::makeFloatRange(), ExpressionRange::makeIntRange(), and ExpressionRange::makeInvalidRange().

Referenced by RelAlgExecutor::computeColRangesCache(), get_value_from_datum(), and getExpressionRange().

524  {
525  bool has_nulls = is_outer_join_proj;
526  int col_id = col_expr->get_column_id();
527  const auto& col_phys_ti = col_expr->get_type_info().is_array()
528  ? col_expr->get_type_info().get_elem_type()
529  : col_expr->get_type_info();
530  const auto col_ti = get_logical_type_info(col_phys_ti);
531  switch (col_ti.get_type()) {
532  case kTEXT:
533  case kCHAR:
534  case kVARCHAR:
535  CHECK_EQ(kENCODING_DICT, col_ti.get_compression());
536  case kBOOLEAN:
537  case kTINYINT:
538  case kSMALLINT:
539  case kINT:
540  case kBIGINT:
541  case kDECIMAL:
542  case kNUMERIC:
543  case kDATE:
544  case kTIMESTAMP:
545  case kTIME:
546  case kFLOAT:
547  case kDOUBLE: {
548  ssize_t ti_idx = -1;
549  for (size_t i = 0; i < query_infos.size(); ++i) {
550  if (col_expr->get_table_id() == query_infos[i].table_id) {
551  ti_idx = i;
552  break;
553  }
554  }
555  CHECK_NE(ssize_t(-1), ti_idx);
556  const auto& query_info = query_infos[ti_idx].info;
557  const auto& fragments = query_info.fragments;
558  const auto cd = executor->getColumnDescriptor(col_expr);
559  if (cd && cd->isVirtualCol) {
560  CHECK(cd->columnName == "rowid");
561  CHECK_EQ(kBIGINT, col_ti.get_type());
562  const int64_t num_tuples = query_info.getNumTuples();
564  0, std::max(num_tuples - 1, int64_t(0)), 0, has_nulls);
565  }
566  if (query_info.getNumTuples() == 0) {
567  // The column doesn't contain any values, synthesize an empty range.
568  if (col_ti.is_fp()) {
569  return col_ti.get_type() == kFLOAT
570  ? ExpressionRange::makeFloatRange(0, -1, false)
571  : ExpressionRange::makeDoubleRange(0, -1, false);
572  }
573  return ExpressionRange::makeIntRange(0, -1, 0, false);
574  }
575  std::vector<size_t> nonempty_fragment_indices;
576  for (size_t i = 0; i < fragments.size(); ++i) {
577  const auto& fragment = fragments[i];
578  if (!fragment.isEmptyPhysicalFragment()) {
579  nonempty_fragment_indices.push_back(i);
580  }
581  }
582  FIND_STAT_FRAG(min);
583  FIND_STAT_FRAG(max);
584  const auto& min_frag = fragments[*min_frag_index];
585  const auto min_it = min_frag.getChunkMetadataMap().find(col_id);
586  if (min_it == min_frag.getChunkMetadataMap().end()) {
588  }
589  const auto& max_frag = fragments[*max_frag_index];
590  const auto max_it = max_frag.getChunkMetadataMap().find(col_id);
591  CHECK(max_it != max_frag.getChunkMetadataMap().end());
592  for (const auto& fragment : fragments) {
593  const auto it = fragment.getChunkMetadataMap().find(col_id);
594  if (it != fragment.getChunkMetadataMap().end()) {
595  if (it->second.chunkStats.has_nulls) {
596  has_nulls = true;
597  break;
598  }
599  }
600  }
601  if (col_ti.is_fp()) {
602  const auto min_val = extract_min_stat_double(min_it->second.chunkStats, col_ti);
603  const auto max_val = extract_max_stat_double(max_it->second.chunkStats, col_ti);
604  return col_ti.get_type() == kFLOAT
605  ? ExpressionRange::makeFloatRange(min_val, max_val, has_nulls)
606  : ExpressionRange::makeDoubleRange(min_val, max_val, has_nulls);
607  }
608  const auto min_val = extract_min_stat(min_it->second.chunkStats, col_ti);
609  const auto max_val = extract_max_stat(max_it->second.chunkStats, col_ti);
610  if (max_val < min_val) {
611  // The column doesn't contain any non-null values, synthesize an empty range.
612  CHECK_GT(min_val, 0);
613  return ExpressionRange::makeIntRange(0, -1, 0, has_nulls);
614  }
615  const int64_t bucket =
616  col_ti.get_type() == kDATE ? get_conservative_datetrunc_bucket(dtDAY) : 0;
617  return ExpressionRange::makeIntRange(min_val, max_val, bucket, has_nulls);
618  }
619  default:
620  break;
621  }
623 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
#define FIND_STAT_FRAG(stat_name)
Definition: sqltypes.h:51
double extract_min_stat_double(const ChunkStats &stats, const SQLTypeInfo &col_ti)
SQLTypeInfo get_logical_type_info(const SQLTypeInfo &type_info)
Definition: sqltypes.h:840
#define CHECK_GT(x, y)
Definition: Logger.h:199
static ExpressionRange makeFloatRange(const float fp_min, const float fp_max, const bool has_nulls)
int64_t get_conservative_datetrunc_bucket(const DatetruncField datetrunc_field)
#define CHECK_NE(x, y)
Definition: Logger.h:196
static ExpressionRange makeIntRange(const int64_t int_min, const int64_t int_max, const int64_t bucket, const bool has_nulls)
Definition: sqltypes.h:54
Definition: sqltypes.h:55
Definition: sqltypes.h:43
int64_t extract_min_stat(const ChunkStats &stats, const SQLTypeInfo &ti)
#define CHECK(condition)
Definition: Logger.h:187
Definition: sqltypes.h:47
static ExpressionRange makeInvalidRange()
double extract_max_stat_double(const ChunkStats &stats, const SQLTypeInfo &col_ti)
int64_t extract_max_stat(const ChunkStats &stats, const SQLTypeInfo &ti)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMax()

template<typename T >
T getMax ( const ExpressionRange other)

◆ getMax< double >()

template<>
double getMax< double > ( const ExpressionRange e)
inline

Definition at line 244 of file ExpressionRange.h.

244  {
245  return e.getFpMax();
246 }
double getFpMax() const

◆ getMax< float >()

template<>
float getMax< float > ( const ExpressionRange e)
inline

Definition at line 239 of file ExpressionRange.h.

239  {
240  return e.getFpMax();
241 }
double getFpMax() const

◆ getMax< int64_t >()

template<>
int64_t getMax< int64_t > ( const ExpressionRange e)
inline

Definition at line 234 of file ExpressionRange.h.

234  {
235  return e.getIntMax();
236 }
int64_t getIntMax() const

◆ getMin()

template<typename T >
T getMin ( const ExpressionRange other)

◆ getMin< double >()

template<>
double getMin< double > ( const ExpressionRange e)
inline

Definition at line 229 of file ExpressionRange.h.

229  {
230  return e.getFpMin();
231 }
double getFpMin() const

◆ getMin< float >()

template<>
float getMin< float > ( const ExpressionRange e)
inline

Definition at line 224 of file ExpressionRange.h.

224  {
225  return e.getFpMin();
226 }
double getFpMin() const

◆ getMin< int64_t >()

template<>
int64_t getMin< int64_t > ( const ExpressionRange e)
inline

Definition at line 219 of file ExpressionRange.h.

219  {
220  return e.getIntMin();
221 }
int64_t getIntMin() const