OmniSciDB  04ee39c94c
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 >, SQLQualifierget_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
 
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::ConstantmakeNumericConstant (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

◆ build_type_info()

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

Definition at line 41 of file RelAlgTranslator.cpp.

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

Referenced by RelAlgTranslator::translateLiteral().

43  {
44  SQLTypeInfo ti(sql_type, 0, 0, true);
45  ti.set_scale(scale);
46  ti.set_precision(precision);
47  return ti;
48 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ datum_from_scalar_tv()

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

Definition at line 73 of file RelAlgTranslator.cpp.

References CHECK, anonymous_namespace{ImportTest.cpp}::d(), 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().

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

◆ fill_dictionary_encoded_in_vals() [1/2]

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 560 of file RelAlgTranslator.cpp.

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

567  {
568  CHECK(in_vals.empty());
569  bool dicts_are_equal = source_dict == dest_dict;
570  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
571  ++index) {
572  const auto row = values_rowset->getOneColRow(index);
573  if (UNLIKELY(!row.valid)) {
574  continue;
575  }
576  if (dicts_are_equal) {
577  in_vals.push_back(row.value);
578  } else {
579  const int string_id =
580  row.value == needle_null_val
581  ? needle_null_val
582  : dest_dict->getIdOfString(source_dict->getString(row.value));
583  if (string_id != StringDictionary::INVALID_STR_ID) {
584  in_vals.push_back(string_id);
585  }
586  }
587  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
588  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
589  throw std::runtime_error(
590  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
591  }
592  }
593 }
int32_t getIdOfString(const std::string &str) const
bool g_enable_watchdog
Definition: Execute.cpp:69
static constexpr int32_t INVALID_STR_ID
std::string getString(int32_t string_id) const
#define UNLIKELY(x)
Definition: likely.h:20
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:

◆ fill_dictionary_encoded_in_vals() [2/2]

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 621 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.

Referenced by RelAlgTranslator::getInIntegerSetExpr().

630  {
631  CHECK(in_vals.empty());
632  std::vector<int32_t> source_ids;
633  source_ids.reserve(values_rowset->entryCount());
634  bool has_nulls = false;
635  if (source_dict_ref == dest_dict_ref) {
636  in_vals.reserve(values_rowset_slice.second - values_rowset_slice.first +
637  1); // Add 1 to cover interval
638  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
639  ++index) {
640  const auto row = values_rowset->getOneColRow(index);
641  if (!row.valid) {
642  continue;
643  }
644  if (row.value != needle_null_val) {
645  in_vals.push_back(row.value);
646  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
647  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
648  throw std::runtime_error(
649  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
650  }
651  } else {
652  has_nulls = true;
653  }
654  }
655  if (has_nulls) {
656  in_vals.push_back(
657  needle_null_val); // we've deduped null values as an optimization, although
658  // this is not required by consumer
659  }
660  return;
661  }
662  // Code path below is for when dictionaries are not shared
663  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
664  ++index) {
665  const auto row = values_rowset->getOneColRow(index);
666  if (row.valid) {
667  if (row.value != needle_null_val) {
668  source_ids.push_back(row.value);
669  } else {
670  has_nulls = true;
671  }
672  }
673  }
674  std::vector<int32_t> dest_ids;
675  translate_string_ids(dest_ids,
676  leaf_hosts.front(),
677  dest_dict_ref,
678  source_ids,
679  source_dict_ref,
680  dest_generation);
681  CHECK_EQ(dest_ids.size(), source_ids.size());
682  in_vals.reserve(dest_ids.size() + (has_nulls ? 1 : 0));
683  if (has_nulls) {
684  in_vals.push_back(needle_null_val);
685  }
686  for (const int32_t dest_id : dest_ids) {
687  if (dest_id != StringDictionary::INVALID_STR_ID) {
688  in_vals.push_back(dest_id);
689  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
690  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
691  throw std::runtime_error(
692  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
693  }
694  }
695  }
696 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
bool g_enable_watchdog
Definition: Execute.cpp:69
static constexpr int32_t INVALID_STR_ID
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
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fill_integer_in_vals()

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 595 of file RelAlgTranslator.cpp.

References CHECK, g_enable_watchdog, g_max_integer_set_size, and UNLIKELY.

Referenced by RelAlgTranslator::getInIntegerSetExpr().

598  {
599  CHECK(in_vals.empty());
600  for (auto index = values_rowset_slice.first; index < values_rowset_slice.second;
601  ++index) {
602  const auto row = values_rowset->getOneColRow(index);
603  if (row.valid) {
604  in_vals.push_back(row.value);
605  if (UNLIKELY(g_enable_watchdog && (in_vals.size() & 1023) == 0 &&
606  total_in_vals_count.fetch_add(1024) >= g_max_integer_set_size)) {
607  throw std::runtime_error(
608  "Unable to handle 'expr IN (subquery)', subquery returned 30M+ rows.");
609  }
610  }
611  }
612 }
bool g_enable_watchdog
Definition: Execute.cpp:69
#define UNLIKELY(x)
Definition: likely.h:20
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function:

◆ get_datetimeplus_rewrite_funcname()

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

Definition at line 1035 of file RelAlgTranslator.cpp.

References CHECK, and kPLUS.

Referenced by RelAlgTranslator::translateDatePlusMinus().

1035  {
1036  CHECK(op == kPLUS);
1037  return "DATETIME_PLUS";
1038 }
Definition: sqldefs.h:41
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function:

◆ get_in_values_expr()

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 416 of file RelAlgTranslator.cpp.

References can_use_parallel_algorithms(), cpu_threads(), anonymous_namespace{ImportTest.cpp}::d(), datum_from_scalar_tv(), g_enable_watchdog, kCAST, and kENCODING_NONE.

Referenced by RelAlgTranslator::translateInOper().

417  {
418  if (!can_use_parallel_algorithms(val_set)) {
419  return nullptr;
420  }
421  if (val_set.rowCount() > 5000000 && g_enable_watchdog) {
422  throw std::runtime_error(
423  "Unable to handle 'expr IN (subquery)', subquery returned 5M+ rows.");
424  }
425  std::list<std::shared_ptr<Analyzer::Expr>> value_exprs;
426  const size_t fetcher_count = cpu_threads();
427  std::vector<std::list<std::shared_ptr<Analyzer::Expr>>> expr_set(
428  fetcher_count, std::list<std::shared_ptr<Analyzer::Expr>>());
429  std::vector<std::future<void>> fetcher_threads;
430  const auto& ti = arg->get_type_info();
431  const auto entry_count = val_set.entryCount();
432  for (size_t i = 0,
433  start_entry = 0,
434  stride = (entry_count + fetcher_count - 1) / fetcher_count;
435  i < fetcher_count && start_entry < entry_count;
436  ++i, start_entry += stride) {
437  const auto end_entry = std::min(start_entry + stride, entry_count);
438  fetcher_threads.push_back(std::async(
439  std::launch::async,
440  [&](std::list<std::shared_ptr<Analyzer::Expr>>& in_vals,
441  const size_t start,
442  const size_t end) {
443  for (auto index = start; index < end; ++index) {
444  auto row = val_set.getRowAt(index);
445  if (row.empty()) {
446  continue;
447  }
448  auto scalar_tv = boost::get<ScalarTargetValue>(&row[0]);
449  Datum d{0};
450  bool is_null_const{false};
451  std::tie(d, is_null_const) = datum_from_scalar_tv(scalar_tv, ti);
452  if (ti.is_string() && ti.get_compression() != kENCODING_NONE) {
453  auto ti_none_encoded = ti;
454  ti_none_encoded.set_compression(kENCODING_NONE);
455  auto none_encoded_string =
456  makeExpr<Analyzer::Constant>(ti, is_null_const, d);
457  auto dict_encoded_string = std::make_shared<Analyzer::UOper>(
458  ti, false, kCAST, none_encoded_string);
459  in_vals.push_back(dict_encoded_string);
460  } else {
461  in_vals.push_back(makeExpr<Analyzer::Constant>(ti, is_null_const, d));
462  }
463  }
464  },
465  std::ref(expr_set[i]),
466  start_entry,
467  end_entry));
468  }
469  for (auto& child : fetcher_threads) {
470  child.get();
471  }
472 
473  val_set.moveToBegin();
474  for (auto& exprs : expr_set) {
475  value_exprs.splice(value_exprs.end(), exprs);
476  }
477  return makeExpr<Analyzer::InValues>(arg, value_exprs);
478 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
bool g_enable_watchdog
Definition: Execute.cpp:69
Definition: sqldefs.h:49
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:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_quantified_rhs()

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 50 of file RelAlgTranslator.cpp.

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

Referenced by RelAlgTranslator::translateOper().

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

◆ makeNumericConstant()

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

Definition at line 938 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().

939  {
940  CHECK(ti.is_number());
941  Datum datum{0};
942  switch (ti.get_type()) {
943  case kTINYINT: {
944  datum.tinyintval = val;
945  break;
946  }
947  case kSMALLINT: {
948  datum.smallintval = val;
949  break;
950  }
951  case kINT: {
952  datum.intval = val;
953  break;
954  }
955  case kBIGINT: {
956  datum.bigintval = val;
957  break;
958  }
959  case kDECIMAL:
960  case kNUMERIC: {
961  datum.bigintval = val * exp_to_scale(ti.get_scale());
962  break;
963  }
964  case kFLOAT: {
965  datum.floatval = val;
966  break;
967  }
968  case kDOUBLE: {
969  datum.doubleval = val;
970  break;
971  }
972  default:
973  CHECK(false);
974  }
975  return makeExpr<Analyzer::Constant>(ti, false, datum);
976 }
HOST DEVICE int get_scale() const
Definition: sqltypes.h:328
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
bool is_number() const
Definition: sqltypes.h:455
#define CHECK(condition)
Definition: Logger.h:187
uint64_t exp_to_scale(const unsigned exp)
Definition: sqltypes.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ supported_lower_bound()

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

◆ supported_upper_bound()

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

Definition at line 1545 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().

1545  {
1546  const auto& window_bound = rex_window_function->getUpperBound();
1547  const bool to_current_row = !window_bound.unbounded && !window_bound.preceding &&
1548  !window_bound.following && window_bound.is_current_row &&
1549  !window_bound.offset && window_bound.order_key == 1;
1550  switch (rex_window_function->getKind()) {
1555  return to_current_row;
1556  }
1557  default: {
1558  return rex_window_function->getOrderKeys().empty()
1559  ? (window_bound.unbounded && !window_bound.preceding &&
1560  window_bound.following && !window_bound.is_current_row &&
1561  !window_bound.offset && window_bound.order_key == 2)
1562  : to_current_row;
1563  }
1564  }
1565 }
SqlWindowFunctionKind getKind() const
const ConstRexScalarPtrVector & getOrderKeys() const
const RexWindowBound & getUpperBound() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ translate_collation()

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

Definition at line 1526 of file RelAlgTranslator.cpp.

References Descending, and First.

Referenced by RelAlgTranslator::translateWindowFunction().

1527  {
1528  std::vector<Analyzer::OrderEntry> collation;
1529  for (size_t i = 0; i < sort_fields.size(); ++i) {
1530  const auto& sort_field = sort_fields[i];
1531  collation.emplace_back(i,
1532  sort_field.getSortDir() == SortDirection::Descending,
1533  sort_field.getNullsPosition() == NullSortedPosition::First);
1534  }
1535  return collation;
1536 }
+ Here is the caller graph for this function:

Variable Documentation

◆ g_max_integer_set_size

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

Definition at line 558 of file RelAlgTranslator.cpp.

Referenced by fill_dictionary_encoded_in_vals(), and fill_integer_in_vals().