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

Functions

SQLTypeInfo build_type_info (const SQLTypes sql_type, const int scale, const int precision)
 
std::pair< std::shared_ptr
< Analyzer::Expr >
, SQLQualifier
get_quantified_rhs (const RexScalar *rex_scalar, const RelAlgTranslator &translator)
 
std::pair< Datum, bool > datum_from_scalar_tv (const ScalarTargetValue *scalar_tv, const SQLTypeInfo &ti) noexcept
 
bool is_agg_supported_for_type (const SQLAgg &agg_kind, const SQLTypeInfo &arg_ti)
 
std::shared_ptr< Analyzer::Exprget_in_values_expr (std::shared_ptr< Analyzer::Expr > arg, const ResultSet &val_set)
 
void fill_dictionary_encoded_in_vals (std::vector< int64_t > &in_vals, std::atomic< size_t > &total_in_vals_count, const ResultSet *values_rowset, const std::pair< int64_t, int64_t > values_rowset_slice, const StringDictionaryProxy *source_dict, const StringDictionaryProxy *dest_dict, const int64_t needle_null_val)
 
void fill_integer_in_vals (std::vector< int64_t > &in_vals, std::atomic< size_t > &total_in_vals_count, const ResultSet *values_rowset, const std::pair< int64_t, int64_t > values_rowset_slice)
 
void fill_dictionary_encoded_in_vals (std::vector< int64_t > &in_vals, std::atomic< size_t > &total_in_vals_count, const ResultSet *values_rowset, const std::pair< int64_t, int64_t > values_rowset_slice, const std::vector< LeafHostInfo > &leaf_hosts, const DictRef source_dict_ref, const DictRef dest_dict_ref, const int32_t dest_generation, const int64_t needle_null_val)
 
std::shared_ptr
< Analyzer::Constant
makeNumericConstant (const SQLTypeInfo &ti, const long val)
 
std::string get_datetimeplus_rewrite_funcname (const SQLOps &op)
 
std::vector< Analyzer::OrderEntrytranslate_collation (const std::vector< SortField > &sort_fields)
 
bool supported_lower_bound (const RexWindowFunctionOperator::RexWindowBound &window_bound)
 
bool supported_upper_bound (const RexWindowFunctionOperator *rex_window_function)
 

Variables

const size_t g_max_integer_set_size {1 << 25}
 

Function Documentation

SQLTypeInfo anonymous_namespace{RelAlgTranslator.cpp}::build_type_info ( const SQLTypes  sql_type,
const int  scale,
const int  precision 
)

Definition at line 44 of file RelAlgTranslator.cpp.

References SQLTypeInfoCore< TYPE_FACET_PACK >::set_precision(), and SQLTypeInfoCore< TYPE_FACET_PACK >::set_scale().

Referenced by RelAlgTranslator::translateLiteral().

46  {
47  SQLTypeInfo ti(sql_type, 0, 0, true);
48  ti.set_scale(scale);
49  ti.set_precision(precision);
50  return ti;
51 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::pair<Datum, bool> anonymous_namespace{RelAlgTranslator.cpp}::datum_from_scalar_tv ( const ScalarTargetValue scalar_tv,
const SQLTypeInfo ti 
)
noexcept

Definition at line 76 of file RelAlgTranslator.cpp.

References CHECK(), inline_fp_null_val(), inline_int_null_val(), kBIGINT, kCHAR, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, and kVARCHAR.

Referenced by get_in_values_expr(), RelAlgTranslator::translateInOper(), and RelAlgTranslator::translateScalarSubquery().

77  {
78  Datum d{0};
79  bool is_null_const{false};
80  switch (ti.get_type()) {
81  case kTINYINT: {
82  const auto ival = boost::get<int64_t>(scalar_tv);
83  CHECK(ival);
84  if (*ival == inline_int_null_val(ti)) {
85  is_null_const = true;
86  } else {
87  d.tinyintval = *ival;
88  }
89  break;
90  }
91  case kSMALLINT: {
92  const auto ival = boost::get<int64_t>(scalar_tv);
93  CHECK(ival);
94  if (*ival == inline_int_null_val(ti)) {
95  is_null_const = true;
96  } else {
97  d.smallintval = *ival;
98  }
99  break;
100  }
101  case kINT: {
102  const auto ival = boost::get<int64_t>(scalar_tv);
103  CHECK(ival);
104  if (*ival == inline_int_null_val(ti)) {
105  is_null_const = true;
106  } else {
107  d.intval = *ival;
108  }
109  break;
110  }
111  case kDECIMAL:
112  case kNUMERIC:
113  case kBIGINT:
114  case kDATE:
115  case kTIME:
116  case kTIMESTAMP: {
117  const auto ival = boost::get<int64_t>(scalar_tv);
118  CHECK(ival);
119  if (*ival == inline_int_null_val(ti)) {
120  is_null_const = true;
121  } else {
122  d.bigintval = *ival;
123  }
124  break;
125  }
126  case kDOUBLE: {
127  const auto dval = boost::get<double>(scalar_tv);
128  CHECK(dval);
129  if (*dval == inline_fp_null_val(ti)) {
130  is_null_const = true;
131  } else {
132  d.doubleval = *dval;
133  }
134  break;
135  }
136  case kFLOAT: {
137  const auto fval = boost::get<float>(scalar_tv);
138  CHECK(fval);
139  if (*fval == inline_fp_null_val(ti)) {
140  is_null_const = true;
141  } else {
142  d.floatval = *fval;
143  }
144  break;
145  }
146  case kTEXT:
147  case kVARCHAR:
148  case kCHAR: {
149  auto nullable_sptr = boost::get<NullableString>(scalar_tv);
150  CHECK(nullable_sptr);
151  if (boost::get<void*>(nullable_sptr)) {
152  is_null_const = true;
153  } else {
154  auto sptr = boost::get<std::string>(nullable_sptr);
155  d.stringval = new std::string(*sptr);
156  }
157  break;
158  }
159  default:
160  CHECK(false);
161  }
162  return {d, is_null_const};
163 }
Definition: sqltypes.h:52
double inline_fp_null_val(const SQL_TYPE_INFO &ti)
CHECK(cgen_state)
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:326
Definition: sqltypes.h:55
Definition: sqltypes.h:56
Definition: sqltypes.h:44
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{RelAlgTranslator.cpp}::fill_dictionary_encoded_in_vals ( std::vector< int64_t > &  in_vals,
std::atomic< size_t > &  total_in_vals_count,
const ResultSet values_rowset,
const std::pair< int64_t, int64_t >  values_rowset_slice,
const StringDictionaryProxy source_dict,
const StringDictionaryProxy dest_dict,
const int64_t  needle_null_val 
)

Definition at line 581 of file RelAlgTranslator.cpp.

References CHECK(), g_enable_watchdog, g_max_integer_set_size, StringDictionaryProxy::getIdOfString(), StringDictionaryProxy::getString(), StringDictionary::INVALID_STR_ID, and UNLIKELY.

Referenced by RelAlgTranslator::getInIntegerSetExpr().

588  {
589  CHECK(in_vals.empty());
590  bool dicts_are_equal = source_dict == dest_dict;
591  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
592  ++index) {
593  const auto row = values_rowset->getOneColRow(index);
594  if (UNLIKELY(!row.valid)) {
595  continue;
596  }
597  if (dicts_are_equal) {
598  in_vals.push_back(row.value);
599  } else {
600  const int string_id =
601  row.value == needle_null_val
602  ? needle_null_val
603  : dest_dict->getIdOfString(source_dict->getString(row.value));
604  if (string_id != StringDictionary::INVALID_STR_ID) {
605  in_vals.push_back(string_id);
606  }
607  }
608  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
609  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
610  throw std::runtime_error(
611  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
612  }
613  }
614 }
std::string getString(int32_t string_id) const
bool g_enable_watchdog
static constexpr int32_t INVALID_STR_ID
CHECK(cgen_state)
#define UNLIKELY(x)
Definition: likely.h:20
int32_t getIdOfString(const std::string &str) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{RelAlgTranslator.cpp}::fill_dictionary_encoded_in_vals ( std::vector< int64_t > &  in_vals,
std::atomic< size_t > &  total_in_vals_count,
const ResultSet values_rowset,
const std::pair< int64_t, int64_t >  values_rowset_slice,
const std::vector< LeafHostInfo > &  leaf_hosts,
const DictRef  source_dict_ref,
const DictRef  dest_dict_ref,
const int32_t  dest_generation,
const int64_t  needle_null_val 
)

Definition at line 642 of file RelAlgTranslator.cpp.

References CHECK(), CHECK_EQ, g_enable_watchdog, g_max_integer_set_size, StringDictionary::INVALID_STR_ID, translate_string_ids(), and UNLIKELY.

651  {
652  CHECK(in_vals.empty());
653  std::vector<int32_t> source_ids;
654  source_ids.reserve(values_rowset->entryCount());
655  bool has_nulls = false;
656  if (source_dict_ref == dest_dict_ref) {
657  in_vals.reserve(values_rowset_slice.second - values_rowset_slice.first +
658  1); // Add 1 to cover interval
659  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
660  ++index) {
661  const auto row = values_rowset->getOneColRow(index);
662  if (!row.valid) {
663  continue;
664  }
665  if (row.value != needle_null_val) {
666  in_vals.push_back(row.value);
667  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
668  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
669  throw std::runtime_error(
670  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
671  }
672  } else {
673  has_nulls = true;
674  }
675  }
676  if (has_nulls) {
677  in_vals.push_back(
678  needle_null_val); // we've deduped null values as an optimization, although
679  // this is not required by consumer
680  }
681  return;
682  }
683  // Code path below is for when dictionaries are not shared
684  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
685  ++index) {
686  const auto row = values_rowset->getOneColRow(index);
687  if (row.valid) {
688  if (row.value != needle_null_val) {
689  source_ids.push_back(row.value);
690  } else {
691  has_nulls = true;
692  }
693  }
694  }
695  std::vector<int32_t> dest_ids;
696  translate_string_ids(dest_ids,
697  leaf_hosts.front(),
698  dest_dict_ref,
699  source_ids,
700  source_dict_ref,
701  dest_generation);
702  CHECK_EQ(dest_ids.size(), source_ids.size());
703  in_vals.reserve(dest_ids.size() + (has_nulls ? 1 : 0));
704  if (has_nulls) {
705  in_vals.push_back(needle_null_val);
706  }
707  for (const int32_t dest_id : dest_ids) {
708  if (dest_id != StringDictionary::INVALID_STR_ID) {
709  in_vals.push_back(dest_id);
710  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
711  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
712  throw std::runtime_error(
713  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
714  }
715  }
716  }
717 }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
bool g_enable_watchdog
static constexpr int32_t INVALID_STR_ID
CHECK(cgen_state)
void translate_string_ids(std::vector< int32_t > &dest_ids, const LeafHostInfo &dict_server_host, const DictRef dest_dict_ref, const std::vector< int32_t > &source_ids, const DictRef source_dict_ref, const int32_t dest_generation)
#define UNLIKELY(x)
Definition: likely.h:20

+ Here is the call graph for this function:

void anonymous_namespace{RelAlgTranslator.cpp}::fill_integer_in_vals ( std::vector< int64_t > &  in_vals,
std::atomic< size_t > &  total_in_vals_count,
const ResultSet values_rowset,
const std::pair< int64_t, int64_t >  values_rowset_slice 
)

Definition at line 616 of file RelAlgTranslator.cpp.

References CHECK(), g_enable_watchdog, g_max_integer_set_size, and UNLIKELY.

Referenced by RelAlgTranslator::getInIntegerSetExpr().

619  {
620  CHECK(in_vals.empty());
621  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
622  ++index) {
623  const auto row = values_rowset->getOneColRow(index);
624  if (row.valid) {
625  in_vals.push_back(row.value);
626  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
627  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
628  throw std::runtime_error(
629  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
630  }
631  }
632  }
633 }
bool g_enable_watchdog
CHECK(cgen_state)
#define UNLIKELY(x)
Definition: likely.h:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string anonymous_namespace{RelAlgTranslator.cpp}::get_datetimeplus_rewrite_funcname ( const SQLOps op)

Definition at line 1056 of file RelAlgTranslator.cpp.

References CHECK(), and kPLUS.

Referenced by RelAlgTranslator::translateDatePlusMinus().

1056  {
1057  CHECK(op == kPLUS);
1058  return "DATETIME_PLUS"s;
1059 }
Definition: sqldefs.h:41
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr<Analyzer::Expr> anonymous_namespace{RelAlgTranslator.cpp}::get_in_values_expr ( std::shared_ptr< Analyzer::Expr arg,
const ResultSet val_set 
)

Definition at line 437 of file RelAlgTranslator.cpp.

References can_use_parallel_algorithms(), cpu_threads(), datum_from_scalar_tv(), g_enable_watchdog, kCAST, and kENCODING_NONE.

Referenced by RelAlgTranslator::translateInOper().

438  {
439  if (!can_use_parallel_algorithms(val_set)) {
440  return nullptr;
441  }
442  if (val_set.rowCount() > 5000000 && g_enable_watchdog) {
443  throw std::runtime_error(
444  "Unable to handle 'expr IN (subquery)', subquery returned 5M+ rows.");
445  }
446  std::list<std::shared_ptr<Analyzer::Expr>> value_exprs;
447  const size_t fetcher_count = cpu_threads();
448  std::vector<std::list<std::shared_ptr<Analyzer::Expr>>> expr_set(
449  fetcher_count, std::list<std::shared_ptr<Analyzer::Expr>>());
450  std::vector<std::future<void>> fetcher_threads;
451  const auto& ti = arg->get_type_info();
452  const auto entry_count = val_set.entryCount();
453  for (size_t i = 0,
454  start_entry = 0,
455  stride = (entry_count + fetcher_count - 1) / fetcher_count;
456  i < fetcher_count && start_entry < entry_count;
457  ++i, start_entry += stride) {
458  const auto end_entry = std::min(start_entry + stride, entry_count);
459  fetcher_threads.push_back(std::async(
460  std::launch::async,
461  [&](std::list<std::shared_ptr<Analyzer::Expr>>& in_vals,
462  const size_t start,
463  const size_t end) {
464  for (auto index = start; index < end; ++index) {
465  auto row = val_set.getRowAt(index);
466  if (row.empty()) {
467  continue;
468  }
469  auto scalar_tv = boost::get<ScalarTargetValue>(&row[0]);
470  Datum d{0};
471  bool is_null_const{false};
472  std::tie(d, is_null_const) = datum_from_scalar_tv(scalar_tv, ti);
473  if (ti.is_string() && ti.get_compression() != kENCODING_NONE) {
474  auto ti_none_encoded = ti;
475  ti_none_encoded.set_compression(kENCODING_NONE);
476  auto none_encoded_string =
477  makeExpr<Analyzer::Constant>(ti, is_null_const, d);
478  auto dict_encoded_string = std::make_shared<Analyzer::UOper>(
479  ti, false, kCAST, none_encoded_string);
480  in_vals.push_back(dict_encoded_string);
481  } else {
482  in_vals.push_back(makeExpr<Analyzer::Constant>(ti, is_null_const, d));
483  }
484  }
485  },
486  std::ref(expr_set[i]),
487  start_entry,
488  end_entry));
489  }
490  for (auto& child : fetcher_threads) {
491  child.get();
492  }
493 
494  val_set.moveToBegin();
495  for (auto& exprs : expr_set) {
496  value_exprs.splice(value_exprs.end(), exprs);
497  }
498  return makeExpr<Analyzer::InValues>(arg, value_exprs);
499 }
Definition: sqldefs.h:49
bool g_enable_watchdog
bool can_use_parallel_algorithms(const ResultSet &rows)
Definition: ResultSet.cpp:869
std::pair< Datum, bool > datum_from_scalar_tv(const ScalarTargetValue *scalar_tv, const SQLTypeInfo &ti) noexcept
int cpu_threads()
Definition: thread_count.h:25

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::pair<std::shared_ptr<Analyzer::Expr>, SQLQualifier> anonymous_namespace{RelAlgTranslator.cpp}::get_quantified_rhs ( const RexScalar rex_scalar,
const RelAlgTranslator translator 
)

Definition at line 53 of file RelAlgTranslator.cpp.

References CHECK_EQ, RexFunctionOperator::getName(), kALL, kANY, kCAST, kONE, and RelAlgTranslator::translateScalarRex().

Referenced by RelAlgTranslator::translateOper().

55  {
56  std::shared_ptr<Analyzer::Expr> rhs;
57  SQLQualifier sql_qual{kONE};
58  const auto rex_operator = dynamic_cast<const RexOperator*>(rex_scalar);
59  if (!rex_operator) {
60  return std::make_pair(rhs, sql_qual);
61  }
62  const auto rex_function = dynamic_cast<const RexFunctionOperator*>(rex_operator);
63  const auto qual_str = rex_function ? rex_function->getName() : "";
64  if (qual_str == "PG_ANY"sv || qual_str == "PG_ALL"sv) {
65  CHECK_EQ(size_t(1), rex_function->size());
66  rhs = translator.translateScalarRex(rex_function->getOperand(0));
67  sql_qual = (qual_str == "PG_ANY"sv) ? kANY : kALL;
68  }
69  if (!rhs && rex_operator->getOperator() == kCAST) {
70  CHECK_EQ(size_t(1), rex_operator->size());
71  std::tie(rhs, sql_qual) = get_quantified_rhs(rex_operator->getOperand(0), translator);
72  }
73  return std::make_pair(rhs, sql_qual);
74 }
Definition: sqldefs.h:69
#define CHECK_EQ(x, y)
Definition: Logger.h:198
SQLQualifier
Definition: sqldefs.h:69
std::shared_ptr< Analyzer::Expr > translateScalarRex(const RexScalar *rex) const
Definition: sqldefs.h:49
Definition: sqldefs.h:69
std::pair< std::shared_ptr< Analyzer::Expr >, SQLQualifier > get_quantified_rhs(const RexScalar *rex_scalar, const RelAlgTranslator &translator)
Definition: sqldefs.h:69
const std::string & getName() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool anonymous_namespace{RelAlgTranslator.cpp}::is_agg_supported_for_type ( const SQLAgg agg_kind,
const SQLTypeInfo arg_ti 
)

Definition at line 203 of file RelAlgTranslator.cpp.

References SQLTypeInfoCore< TYPE_FACET_PACK >::is_boolean(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_number(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_time(), kAVG, kMAX, kMIN, and kSUM.

Referenced by RelAlgTranslator::translateAggregateRex().

203  {
204  if ((agg_kind == kMIN || agg_kind == kMAX || agg_kind == kSUM || agg_kind == kAVG) &&
205  !(arg_ti.is_number() || arg_ti.is_boolean() || arg_ti.is_time())) {
206  return false;
207  }
208 
209  return true;
210 }
bool is_boolean() const
Definition: sqltypes.h:484
bool is_number() const
Definition: sqltypes.h:482
Definition: sqldefs.h:71
bool is_time() const
Definition: sqltypes.h:483
Definition: sqldefs.h:71
Definition: sqldefs.h:71
Definition: sqldefs.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr<Analyzer::Constant> anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant ( const SQLTypeInfo ti,
const long  val 
)

Definition at line 959 of file RelAlgTranslator.cpp.

References CHECK(), exp_to_scale(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_scale(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_type(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_number(), kBIGINT, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, and kTINYINT.

Referenced by RelAlgTranslator::translateAbs(), RelAlgTranslator::translateCardinality(), RelAlgTranslator::translateDateadd(), RelAlgTranslator::translateDatePlusMinus(), and RelAlgTranslator::translateSign().

960  {
961  CHECK(ti.is_number());
962  Datum datum{0};
963  switch (ti.get_type()) {
964  case kTINYINT: {
965  datum.tinyintval = val;
966  break;
967  }
968  case kSMALLINT: {
969  datum.smallintval = val;
970  break;
971  }
972  case kINT: {
973  datum.intval = val;
974  break;
975  }
976  case kBIGINT: {
977  datum.bigintval = val;
978  break;
979  }
980  case kDECIMAL:
981  case kNUMERIC: {
982  datum.bigintval = val * exp_to_scale(ti.get_scale());
983  break;
984  }
985  case kFLOAT: {
986  datum.floatval = val;
987  break;
988  }
989  case kDOUBLE: {
990  datum.doubleval = val;
991  break;
992  }
993  default:
994  CHECK(false);
995  }
996  return makeExpr<Analyzer::Constant>(ti, false, datum);
997 }
HOST DEVICE int get_scale() const
Definition: sqltypes.h:331
bool is_number() const
Definition: sqltypes.h:482
CHECK(cgen_state)
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:326
uint64_t exp_to_scale(const unsigned exp)
Definition: sqltypes.h:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool anonymous_namespace{RelAlgTranslator.cpp}::supported_lower_bound ( const RexWindowFunctionOperator::RexWindowBound window_bound)
bool anonymous_namespace{RelAlgTranslator.cpp}::supported_upper_bound ( const RexWindowFunctionOperator rex_window_function)

Definition at line 1588 of file RelAlgTranslator.cpp.

References CUME_DIST, DENSE_RANK, RexWindowFunctionOperator::getKind(), RexWindowFunctionOperator::getOrderKeys(), RexWindowFunctionOperator::getUpperBound(), RANK, ROW_NUMBER, and RexWindowFunctionOperator::RexWindowBound::unbounded.

Referenced by RelAlgTranslator::translateWindowFunction().

1588  {
1589  const auto& window_bound = rex_window_function->getUpperBound();
1590  const bool to_current_row = !window_bound.unbounded && !window_bound.preceding &&
1591  !window_bound.following && window_bound.is_current_row &&
1592  !window_bound.offset && window_bound.order_key == 1;
1593  switch (rex_window_function->getKind()) {
1598  return to_current_row;
1599  }
1600  default: {
1601  return rex_window_function->getOrderKeys().empty()
1602  ? (window_bound.unbounded && !window_bound.preceding &&
1603  window_bound.following && !window_bound.is_current_row &&
1604  !window_bound.offset && window_bound.order_key == 2)
1605  : to_current_row;
1606  }
1607  }
1608 }
SqlWindowFunctionKind getKind() const
const RexWindowBound & getUpperBound() const
const ConstRexScalarPtrVector & getOrderKeys() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector<Analyzer::OrderEntry> anonymous_namespace{RelAlgTranslator.cpp}::translate_collation ( const std::vector< SortField > &  sort_fields)

Definition at line 1569 of file RelAlgTranslator.cpp.

References Descending, and First.

Referenced by RelAlgTranslator::translateWindowFunction().

1570  {
1571  std::vector<Analyzer::OrderEntry> collation;
1572  for (size_t i = 0; i < sort_fields.size(); ++i) {
1573  const auto& sort_field = sort_fields[i];
1574  collation.emplace_back(i,
1575  sort_field.getSortDir() == SortDirection::Descending,
1576  sort_field.getNullsPosition() == NullSortedPosition::First);
1577  }
1578  return collation;
1579 }

+ Here is the caller graph for this function:

Variable Documentation

const size_t anonymous_namespace{RelAlgTranslator.cpp}::g_max_integer_set_size {1 << 25}

Definition at line 579 of file RelAlgTranslator.cpp.

Referenced by fill_dictionary_encoded_in_vals(), and fill_integer_in_vals().