40 #include <type_traits>
50 template <
typename Tp,
typename... Args>
51 inline typename std::enable_if<std::is_base_of<Analyzer::Expr, Tp>::value,
54 return std::make_shared<Tp>(std::forward<Args>(
args)...);
68 class Expr :
public std::enable_shared_from_this<Expr> {
78 std::shared_ptr<Analyzer::Expr>
get_shared_ptr() {
return shared_from_this(); }
85 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const {};
86 virtual std::shared_ptr<Analyzer::Expr>
deep_copy()
104 std::list<const Expr*>& join_predicates,
105 std::list<const Expr*>& const_predicates)
const {}
120 bool include_agg)
const {}
130 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const {
139 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const {
149 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const {
153 virtual std::string
toString()
const = 0;
156 virtual void add_unique(std::list<const Expr*>& expr_list)
const;
164 std::list<const Expr*>& expr_list)
const {
207 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
208 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
210 std::list<const Expr*>& join_predicates,
211 std::list<const Expr*>& const_predicates)
const override;
220 return l_column_key < r_column_key;
225 bool include_agg)
const override {
226 colvar_set.insert(
this);
230 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
232 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
234 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
236 std::string
toString()
const override;
253 const std::vector<std::shared_ptr<Analyzer::Expr>>&
getTuple()
const {
return tuple_; }
257 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
260 std::string
toString()
const override;
263 const std::vector<std::shared_ptr<Analyzer::Expr>>
tuple_;
290 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
291 std::string
toString()
const override;
293 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
295 rte_idx_set.insert(-1);
298 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
302 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
306 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
344 const std::list<std::shared_ptr<Analyzer::Expr>>& l)
353 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
356 std::string
toString()
const override;
387 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
388 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
390 std::list<const Expr*>& join_predicates,
391 std::list<const Expr*>& const_predicates)
const override;
393 operand->collect_rte_idx(rte_idx_set);
398 bool include_agg)
const override {
399 operand->collect_column_var(colvar_set, include_agg);
402 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
403 return makeExpr<UOper>(
407 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
408 return makeExpr<UOper>(
412 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
413 return makeExpr<UOper>(
417 std::string
toString()
const override;
419 std::list<const Expr*>& expr_list)
const override;
439 std::shared_ptr<Analyzer::Expr> l,
440 std::shared_ptr<Analyzer::Expr> r)
445 std::shared_ptr<Analyzer::Expr> l,
446 std::shared_ptr<Analyzer::Expr> r)
473 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
474 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
477 std::list<const Expr*>& join_predicates,
478 std::list<const Expr*>& const_predicates)
const override;
486 bool include_agg)
const override {
487 left_operand->collect_column_var(colvar_set, include_agg);
491 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
500 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
509 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
518 std::string
toString()
const override;
520 std::list<const Expr*>& expr_list)
const override;
522 const std::shared_ptr<Analyzer::Expr> cast_operand,
523 const std::shared_ptr<Analyzer::Expr> const_operand);
540 const bool r_inclusive,
541 std::shared_ptr<Analyzer::Expr> l,
542 std::shared_ptr<Analyzer::Expr> r)
555 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
557 std::string
toString()
const override;
567 bool include_agg)
const override {
596 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
598 std::list<const Expr*>& join_predicates,
599 std::list<const Expr*>& const_predicates)
const override {
606 bool include_agg)
const override {
610 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
614 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
618 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
625 std::string
toString()
const override;
627 std::list<const Expr*>& expr_list)
const override {
642 InValues(std::shared_ptr<Analyzer::Expr>
a,
643 const std::list<std::shared_ptr<Analyzer::Expr>>& l);
649 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
651 std::list<const Expr*>& join_predicates,
652 std::list<const Expr*>& const_predicates)
const override;
654 arg->collect_rte_idx(rte_idx_set);
659 bool include_agg)
const override {
660 arg->collect_column_var(colvar_set, include_agg);
663 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
665 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
667 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
669 std::string
toString()
const override;
671 std::list<const Expr*>& expr_list)
const override;
674 std::shared_ptr<Analyzer::Expr>
arg;
675 const std::list<std::shared_ptr<Analyzer::Expr>>
689 InIntegerSet(
const std::shared_ptr<const Analyzer::Expr> a,
690 const std::vector<int64_t>& values,
691 const bool not_null);
697 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
700 std::string
toString()
const override;
703 const std::shared_ptr<const Analyzer::Expr>
arg;
710 const std::vector<std::shared_ptr<Analyzer::Expr>>& regressors)
717 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
720 std::list<const Expr*>& join_predicates,
721 std::list<const Expr*>& const_predicates)
const override;
725 regressor_value->collect_rte_idx(rte_idx_set);
732 bool include_agg)
const override {
734 regressor_value->collect_column_var(colvar_set, include_agg);
739 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
740 std::vector<std::shared_ptr<Analyzer::Expr>> new_regressor_values;
742 new_regressor_values.push_back(r->deep_copy());
744 return makeExpr<MLPredictExpr>(
model_value_->rewrite_with_targetlist(tlist),
745 new_regressor_values);
749 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
750 std::vector<std::shared_ptr<Analyzer::Expr>> new_regressor_values;
752 new_regressor_values.push_back(r->deep_copy());
754 return makeExpr<MLPredictExpr>(
model_value_->rewrite_with_child_targetlist(tlist),
755 new_regressor_values);
759 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
760 std::vector<std::shared_ptr<Analyzer::Expr>> new_regressor_values;
762 new_regressor_values.push_back(r->deep_copy());
764 return makeExpr<MLPredictExpr>(
model_value_->rewrite_agg_to_var(tlist),
765 new_regressor_values);
769 std::string
toString()
const override;
771 std::list<const Expr*>& expr_list)
const override;
781 const std::vector<std::shared_ptr<Analyzer::Expr>>& features,
782 const std::shared_ptr<Analyzer::Expr>& pc_dimension)
793 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
796 std::list<const Expr*>& join_predicates,
797 std::list<const Expr*>& const_predicates)
const override;
801 feature_value->collect_rte_idx(rte_idx_set);
808 bool include_agg)
const override {
810 feature_value->collect_column_var(colvar_set, include_agg);
815 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
816 std::vector<std::shared_ptr<Analyzer::Expr>> new_feature_values;
818 new_feature_values.push_back(r->deep_copy());
820 return makeExpr<PCAProjectExpr>(
model_value_->rewrite_with_targetlist(tlist),
826 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
827 std::vector<std::shared_ptr<Analyzer::Expr>> new_feature_values;
829 new_feature_values.push_back(r->deep_copy());
831 return makeExpr<PCAProjectExpr>(
838 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
839 std::vector<std::shared_ptr<Analyzer::Expr>> new_feature_values;
841 new_feature_values.push_back(r->deep_copy());
843 return makeExpr<PCAProjectExpr>(
model_value_->rewrite_agg_to_var(tlist),
849 std::string
toString()
const override;
851 std::list<const Expr*>& expr_list)
const override;
871 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
873 std::list<const Expr*>& join_predicates,
874 std::list<const Expr*>& const_predicates)
const override;
876 arg->collect_rte_idx(rte_idx_set);
881 bool include_agg)
const override {
882 arg->collect_column_var(colvar_set, include_agg);
885 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
886 return makeExpr<CharLengthExpr>(
arg->rewrite_with_targetlist(tlist),
890 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
891 return makeExpr<CharLengthExpr>(
arg->rewrite_with_child_targetlist(tlist),
895 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
899 std::string
toString()
const override;
901 std::list<const Expr*>& expr_list)
const override;
904 std::shared_ptr<Analyzer::Expr>
arg;
919 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
921 std::list<const Expr*>& join_predicates,
922 std::list<const Expr*>& const_predicates)
const override;
924 arg->collect_rte_idx(rte_idx_set);
929 bool include_agg)
const override {
930 arg->collect_column_var(colvar_set, include_agg);
933 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
934 return makeExpr<KeyForStringExpr>(
arg->rewrite_with_targetlist(tlist));
937 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
938 return makeExpr<KeyForStringExpr>(
arg->rewrite_with_child_targetlist(tlist));
941 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
942 return makeExpr<KeyForStringExpr>(
arg->rewrite_agg_to_var(tlist));
945 std::string
toString()
const override;
947 std::list<const Expr*>& expr_list)
const override;
950 std::shared_ptr<Analyzer::Expr>
arg;
964 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
966 std::list<const Expr*>& join_predicates,
967 std::list<const Expr*>& const_predicates)
const override;
969 arg->collect_rte_idx(rte_idx_set);
974 bool include_agg)
const override {
975 arg->collect_column_var(colvar_set, include_agg);
978 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
979 return makeExpr<SampleRatioExpr>(
arg->rewrite_with_targetlist(tlist));
982 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
983 return makeExpr<SampleRatioExpr>(
arg->rewrite_with_child_targetlist(tlist));
986 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
987 return makeExpr<SampleRatioExpr>(
arg->rewrite_agg_to_var(tlist));
990 std::string
toString()
const override;
992 std::list<const Expr*>& expr_list)
const override;
995 std::shared_ptr<Analyzer::Expr>
arg;
1009 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1011 std::list<const Expr*>& join_predicates,
1012 std::list<const Expr*>& const_predicates)
const override;
1014 arg->collect_rte_idx(rte_idx_set);
1019 bool include_agg)
const override {
1020 arg->collect_column_var(colvar_set, include_agg);
1023 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1024 return makeExpr<CardinalityExpr>(
arg->rewrite_with_targetlist(tlist));
1027 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1028 return makeExpr<CardinalityExpr>(
arg->rewrite_with_child_targetlist(tlist));
1031 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1032 return makeExpr<CardinalityExpr>(
arg->rewrite_agg_to_var(tlist));
1035 std::string
toString()
const override;
1037 std::list<const Expr*>& expr_list)
const override;
1040 std::shared_ptr<Analyzer::Expr>
arg;
1051 std::shared_ptr<Analyzer::Expr> l,
1052 std::shared_ptr<Analyzer::Expr> e,
1067 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1069 std::list<const Expr*>& join_predicates,
1070 std::list<const Expr*>& const_predicates)
const override;
1072 arg->collect_rte_idx(rte_idx_set);
1077 bool include_agg)
const override {
1078 arg->collect_column_var(colvar_set, include_agg);
1081 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1082 return makeExpr<LikeExpr>(
arg->rewrite_with_targetlist(tlist),
1089 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1090 return makeExpr<LikeExpr>(
arg->rewrite_with_child_targetlist(tlist),
1097 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1098 return makeExpr<LikeExpr>(
arg->rewrite_agg_to_var(tlist),
1105 std::string
toString()
const override;
1107 std::list<const Expr*>& expr_list)
const override;
1110 std::shared_ptr<Analyzer::Expr>
arg;
1112 std::shared_ptr<Analyzer::Expr>
1127 std::shared_ptr<Analyzer::Expr> p,
1128 std::shared_ptr<Analyzer::Expr> e)
1137 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1139 std::list<const Expr*>& join_predicates,
1140 std::list<const Expr*>& const_predicates)
const override;
1142 arg->collect_rte_idx(rte_idx_set);
1147 bool include_agg)
const override {
1148 arg->collect_column_var(colvar_set, include_agg);
1151 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1152 return makeExpr<RegexpExpr>(
arg->rewrite_with_targetlist(tlist),
1157 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1158 return makeExpr<RegexpExpr>(
arg->rewrite_with_child_targetlist(tlist),
1163 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1164 return makeExpr<RegexpExpr>(
arg->rewrite_agg_to_var(tlist),
1169 std::string
toString()
const override;
1171 std::list<const Expr*>& expr_list)
const override;
1174 std::shared_ptr<Analyzer::Expr>
arg;
1175 std::shared_ptr<Analyzer::Expr>
1177 std::shared_ptr<Analyzer::Expr>
1188 const std::shared_ptr<Analyzer::Expr>
lower_bound,
1189 const std::shared_ptr<Analyzer::Expr>
upper_bound,
1190 const std::shared_ptr<Analyzer::Expr> partition_count)
1202 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1204 std::list<const Expr*>& join_predicates,
1205 std::list<const Expr*>& const_predicates)
const override;
1212 bool include_agg)
const override {
1216 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1217 return makeExpr<WidthBucketExpr>(
target_value_->rewrite_with_targetlist(tlist),
1223 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1224 return makeExpr<WidthBucketExpr>(
target_value_->rewrite_with_child_targetlist(tlist),
1230 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1231 return makeExpr<WidthBucketExpr>(
target_value_->rewrite_agg_to_var(tlist),
1240 std::string
toString()
const override;
1242 std::list<const Expr*>& expr_list)
const override;
1270 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1272 std::list<const Expr*>& join_predicates,
1273 std::list<const Expr*>& const_predicates)
const override;
1275 arg->collect_rte_idx(rte_idx_set);
1280 bool include_agg)
const override {
1281 arg->collect_column_var(colvar_set, include_agg);
1284 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1285 return makeExpr<LikelihoodExpr>(
arg->rewrite_with_targetlist(tlist),
likelihood);
1288 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1289 return makeExpr<LikelihoodExpr>(
arg->rewrite_with_child_targetlist(tlist),
1293 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override {
1294 return makeExpr<LikelihoodExpr>(
arg->rewrite_agg_to_var(tlist),
likelihood);
1297 std::string
toString()
const override;
1299 std::list<const Expr*>& expr_list)
const override;
1302 std::shared_ptr<Analyzer::Expr>
arg;
1314 std::shared_ptr<Analyzer::Expr> g,
1316 std::shared_ptr<Analyzer::Expr> e)
1322 std::shared_ptr<Analyzer::Expr> e,
1334 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1336 std::list<const Expr*>& join_predicates,
1337 std::list<const Expr*>& const_predicates)
const override;
1340 arg->collect_rte_idx(rte_idx_set);
1346 bool include_agg)
const override {
1347 if (include_agg &&
arg !=
nullptr) {
1348 arg->collect_column_var(colvar_set, include_agg);
1352 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1354 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1356 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1358 std::string
toString()
const override;
1360 std::list<const Expr*>& expr_list)
const override;
1364 std::shared_ptr<Analyzer::Expr>
arg;
1367 std::shared_ptr<Analyzer::Expr>
arg1;
1378 const std::list<std::pair<std::shared_ptr<Analyzer::Expr>,
1379 std::shared_ptr<Analyzer::Expr>>>& w,
1380 std::shared_ptr<Analyzer::Expr> e)
1383 std::pair<std::shared_ptr<Analyzer::Expr>, std::shared_ptr<Analyzer::Expr>>>&
1388 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1390 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
1392 std::list<const Expr*>& join_predicates,
1393 std::list<const Expr*>& const_predicates)
const override;
1398 bool include_agg)
const override;
1400 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1402 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1404 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1406 std::string
toString()
const override;
1408 std::list<const Expr*>& expr_list)
const override;
1413 std::list<std::pair<std::shared_ptr<Analyzer::Expr>, std::shared_ptr<Analyzer::Expr>>>
1429 std::shared_ptr<Analyzer::Expr> e)
1434 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1436 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
1438 std::list<const Expr*>& join_predicates,
1439 std::list<const Expr*>& const_predicates)
const override;
1444 bool include_agg)
const override;
1446 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1448 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1450 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1452 std::string
toString()
const override;
1454 std::list<const Expr*>& expr_list)
const override;
1469 const std::shared_ptr<Analyzer::Expr> number,
1470 const std::shared_ptr<Analyzer::Expr> datetime)
1481 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1483 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
1485 std::list<const Expr*>& join_predicates,
1486 std::list<const Expr*>& const_predicates)
const override;
1491 bool include_agg)
const override;
1493 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1495 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1497 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1499 std::string
toString()
const override;
1501 std::list<const Expr*>& expr_list)
const override;
1521 const std::shared_ptr<Analyzer::Expr> start,
1522 const std::shared_ptr<Analyzer::Expr> end)
1527 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1529 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
1531 std::list<const Expr*>& join_predicates,
1532 std::list<const Expr*>& const_predicates)
const override;
1537 bool include_agg)
const override;
1539 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1541 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1543 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1545 std::string
toString()
const override;
1547 std::list<const Expr*>& expr_list)
const override;
1551 const std::shared_ptr<Analyzer::Expr>
start_;
1552 const std::shared_ptr<Analyzer::Expr>
end_;
1564 std::shared_ptr<Analyzer::Expr> e)
1569 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1571 const std::list<std::shared_ptr<Analyzer::Expr>>& groupby)
const override;
1573 std::list<const Expr*>& join_predicates,
1574 std::list<const Expr*>& const_predicates)
const override;
1579 bool include_agg)
const override;
1581 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1583 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1585 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1587 std::string
toString()
const override;
1589 std::list<const Expr*>& expr_list)
const override;
1608 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args)
1613 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args)
1617 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args,
1618 const size_t min_args,
1619 const std::vector<OperandTypeFamily>& expected_type_families,
1620 const std::vector<std::string>& arg_names)
1624 expected_type_families,
1634 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args,
1635 const size_t min_args,
1636 const std::vector<OperandTypeFamily>& expected_type_families,
1637 const std::vector<std::string>& arg_names)
1641 expected_type_families,
1651 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args,
1652 const std::vector<std::shared_ptr<Analyzer::Expr>>& chained_string_op_exprs)
1667 kind_ = other_string_oper->kind_;
1668 args_ = other_string_oper->args_;
1677 size_t num_literals{0UL};
1678 for (
const auto& arg :
args_) {
1679 if (dynamic_cast<const Constant*>(arg.get())) {
1683 return num_literals;
1690 return args_[i].get();
1693 std::shared_ptr<Analyzer::Expr>
getOwnArg(
const size_t i)
const {
1706 if (return_ti.is_none_encoded_string() ||
1707 (return_ti.is_dict_encoded_string() &&
1708 return_ti.getStringDictKey().isTransientDict())) {
1719 size_t num_var_str_args{0};
1720 for (
const auto& arg :
args_) {
1726 if (arg_ti.is_none_encoded_string() ||
1727 (arg_ti.is_dict_encoded_string() &&
1728 arg_ti.getStringDictKey().isTransientDict())) {
1733 return num_var_str_args > 1UL;
1741 bool include_agg)
const override;
1744 if (
args_.empty()) {
1747 const auto& arg0_ti =
args_[0]->get_type_info();
1748 if (!arg0_ti.is_string()) {
1751 if (arg0_ti.is_none_encoded_string()) {
1754 CHECK(arg0_ti.is_dict_encoded_string());
1755 return arg0_ti.getStringDictKey().isTransientDict();
1774 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1777 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1780 const std::vector<std::shared_ptr<TargetEntry>>& tlist)
const override;
1782 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1785 std::list<const Expr*>& join_predicates,
1786 std::list<const Expr*>& const_predicates)
const override;
1790 std::string
toString()
const override;
1793 std::list<const Expr*>& expr_list)
const override;
1811 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args);
1814 const std::vector<OperandTypeFamily>& expected_type_families,
1815 const std::vector<std::string>& arg_names,
1816 const bool dict_encoded_cols_only =
false,
1817 const bool cols_first_arg_only =
true)
const;
1820 std::vector<std::shared_ptr<Analyzer::Expr>>
args_;
1843 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1851 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
1872 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1880 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
1902 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1909 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
1931 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1938 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
1944 const std::shared_ptr<Analyzer::Expr>& num_repeats)
1946 {operand, num_repeats},
1961 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
1969 return {
"operand",
"num_repeats"};
1976 const std::shared_ptr<Analyzer::Expr>& right_operand)
1994 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2002 return {
"left operand",
"right operand"};
2007 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands);
2010 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands);
2016 const std::shared_ptr<Analyzer::Expr>& operand,
2017 const std::shared_ptr<Analyzer::Expr>& padded_length,
2018 const std::shared_ptr<Analyzer::Expr>& padding_str)
2020 {operand, padded_length, padding_str},
2026 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands)
2036 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2046 return {
"operand",
"padded length",
"padding string"};
2056 const std::shared_ptr<Analyzer::Expr>& operand,
2057 const std::shared_ptr<Analyzer::Expr>& trim_chars)
2059 {operand, trim_chars},
2065 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands)
2075 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2083 return {
"operand",
"trim_chars"};
2092 throw std::runtime_error(
"Invalid trim type supplied to TRIM operator");
2094 return trim_op_kind;
2099 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args);
2102 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands,
2109 const std::shared_ptr<Analyzer::Expr>& start_pos)
2111 {operand, start_pos},
2117 const std::shared_ptr<Analyzer::Expr>& start_pos,
2118 const std::shared_ptr<Analyzer::Expr>& length)
2120 {operand, start_pos, length},
2135 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2142 OperandTypeFamily::INT_FAMILY};
2145 return {
"operand",
"start position",
"substring length"};
2152 const std::shared_ptr<Analyzer::Expr>& replacing_str,
2153 const std::shared_ptr<Analyzer::Expr>& start_pos)
2155 {operand, replacing_str, start_pos},
2161 const std::shared_ptr<Analyzer::Expr>& replacing_str,
2162 const std::shared_ptr<Analyzer::Expr>& start_pos,
2163 const std::shared_ptr<Analyzer::Expr>& replacing_length)
2165 {operand, replacing_str, start_pos, replacing_length},
2173 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2188 OperandTypeFamily::INT_FAMILY};
2191 return {
"operand",
"replacing string",
"start position",
"replacing length"};
2198 const std::shared_ptr<Analyzer::Expr>& search_pattern,
2199 const std::shared_ptr<Analyzer::Expr>& replacing_str)
2201 {operand, search_pattern, replacing_str},
2216 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2223 OperandTypeFamily::STRING_FAMILY};
2226 return {
"operand",
"search pattern",
"replacing string"};
2233 const std::shared_ptr<Analyzer::Expr>& delimiter,
2234 const std::shared_ptr<Analyzer::Expr>& split_index)
2236 {operand, delimiter, split_index},
2251 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2261 return {
"operand",
"delimiter",
"split index"};
2268 const std::shared_ptr<Analyzer::Expr>& regex_pattern,
2269 const std::shared_ptr<Analyzer::Expr>& replacing_str,
2270 const std::shared_ptr<Analyzer::Expr>& start_pos,
2271 const std::shared_ptr<Analyzer::Expr>& occurrence,
2272 const std::shared_ptr<Analyzer::Expr>& regex_params)
2275 {operand, regex_pattern, replacing_str, start_pos, occurrence, regex_params},
2290 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2300 OperandTypeFamily::STRING_FAMILY};
2308 "regex parameters"};
2315 const std::shared_ptr<Analyzer::Expr>& regex_pattern,
2316 const std::shared_ptr<Analyzer::Expr>& start_pos,
2317 const std::shared_ptr<Analyzer::Expr>& occurrence,
2318 const std::shared_ptr<Analyzer::Expr>& regex_params,
2319 const std::shared_ptr<Analyzer::Expr>& sub_match_group_idx)
2326 sub_match_group_idx},
2341 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2351 OperandTypeFamily::INT_FAMILY};
2359 "sub-match group index"};
2366 const std::shared_ptr<Analyzer::Expr>& regex_pattern,
2367 const std::shared_ptr<Analyzer::Expr>& start_pos,
2368 const std::shared_ptr<Analyzer::Expr>& regex_params)
2371 {operand, regex_pattern, start_pos, regex_params},
2387 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2395 OperandTypeFamily::STRING_FAMILY};
2398 return {
"operand",
"regex pattern",
"start position",
"regex parameters"};
2405 const std::shared_ptr<Analyzer::Expr>& json_path)
2407 {operand, json_path},
2422 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2430 return {
"operand",
"JSON path"};
2453 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2460 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
2482 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2489 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
2511 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2519 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
2541 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2549 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
2563 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands)
2574 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2581 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
2587 const std::shared_ptr<Analyzer::Expr>& source_str,
2588 const std::shared_ptr<Analyzer::Expr>& start_offset)
2591 {source_str, search_str, start_offset},
2607 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2617 return {
"search string",
"source string",
"start position"};
2622 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands);
2628 const std::shared_ptr<Analyzer::Expr>& right_operand)
2632 {left_operand, right_operand}),
2638 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands)
2647 const std::shared_ptr<Analyzer::StringOper>& string_oper)
2650 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2658 return {
"left operand",
"right operand"};
2663 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands);
2669 const std::shared_ptr<Analyzer::Expr>& right_operand)
2673 {left_operand, right_operand}),
2679 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands)
2690 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2698 return {
"left operand",
"right operand"};
2703 const std::vector<std::shared_ptr<Analyzer::Expr>>& operands);
2727 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2734 std::vector<std::string>
getArgNames()
const override {
return {
"operand"}; }
2740 const std::string&
name,
2741 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args)
2750 return args_[i].get();
2753 std::shared_ptr<Analyzer::Expr>
getOwnArg(
const size_t i)
const {
2758 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2763 bool include_agg)
const override;
2765 std::list<const Expr*>& expr_list)
const override;
2768 std::string
toString()
const override;
2772 const std::vector<std::shared_ptr<Analyzer::Expr>>
args_;
2779 const std::string&
name,
2780 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args)
2783 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2796 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2799 std::string
toString()
const override;
2823 const std::shared_ptr<Analyzer::Expr> bound_expr)
2835 const auto bound_ti =
bound_expr_->get_type_info();
2836 return bound_ti.is_date() || bound_ti.is_timestamp();
2845 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2849 std::string
toString()
const override;
2878 static constexpr std::array<SqlWindowFunctionKind, 9>
2903 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args,
2904 const std::vector<std::shared_ptr<Analyzer::Expr>>& partition_keys,
2905 const std::vector<std::shared_ptr<Analyzer::Expr>>& order_keys,
2907 const std::shared_ptr<Expr> frame_start_bound,
2908 const std::shared_ptr<Expr> frame_end_bound,
2909 const std::vector<OrderEntry>& collation)
2920 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
2923 std::string
toString()
const override;
2927 const std::vector<std::shared_ptr<Analyzer::Expr>>&
getArgs()
const {
return args_; }
2938 std::shared_ptr<WindowFrame> frame_start_bound =
2940 CHECK(frame_start_bound);
2941 return frame_start_bound.get();
2945 std::shared_ptr<WindowFrame> frame_end_bound =
2947 CHECK(frame_end_bound);
2948 return frame_end_bound.get();
2995 const std::vector<std::shared_ptr<Analyzer::Expr>>
args_;
3014 bool local_alloc =
false)
3021 std::string
toString()
const override;
3036 bool include_agg)
const override;
3053 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args)
3056 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
3059 std::string
toString()
const override;
3063 const std::vector<std::shared_ptr<Analyzer::Expr>>&
getArgs0()
const {
return args0_; }
3068 const std::vector<std::shared_ptr<Analyzer::Expr>>
args0_;
3081 const std::vector<std::shared_ptr<Analyzer::Expr>>& args0,
3082 const std::vector<std::shared_ptr<Analyzer::Expr>>& args1)
3085 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
3088 std::string
toString()
const override;
3093 const std::vector<std::shared_ptr<Analyzer::Expr>>&
getArgs0()
const {
return args0_; }
3094 const std::vector<std::shared_ptr<Analyzer::Expr>>&
getArgs1()
const {
return args1_; }
3100 const std::vector<std::shared_ptr<Analyzer::Expr>>
args0_;
3101 const std::vector<std::shared_ptr<Analyzer::Expr>>
args1_;
3110 TargetEntry(
const std::string&
n, std::shared_ptr<Analyzer::Expr> e,
bool u)
3124 std::shared_ptr<Analyzer::Expr>
expr;
3186 int get_rte_idx(
const std::string& range_var_name)
const;
3234 const int32_t range_table_index,
3235 const bool with_bounds)
3252 std::shared_ptr<Analyzer::Expr>
deep_copy()
const final;
3254 std::string
toString()
const final;
3267 std::unique_ptr<Geospatial::GeoBase>
geo_;
3277 const std::string&
name,
3278 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args,
3279 const std::optional<int>& output_srid_override = std::nullopt);
3281 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
3288 bool include_agg)
const final;
3290 std::string
toString()
const override;
3294 size_t size()
const;
3300 std::vector<std::shared_ptr<Analyzer::Expr>>
getArgs()
const {
return args_; }
3303 std::vector<Analyzer::Expr*> ret;
3304 ret.reserve(
args_.size());
3305 for (
const auto& arg :
args_) {
3306 ret.push_back(arg.get());
3317 const std::vector<std::shared_ptr<Analyzer::Expr>>
args_;
3326 const std::string&
name,
3327 const std::vector<std::shared_ptr<Analyzer::Expr>>&
args,
3328 const int32_t input_srid,
3329 const int32_t output_srid)
3332 std::shared_ptr<Analyzer::Expr>
deep_copy()
const override;
3334 std::string
toString()
const override;
3354 const int rte_idx = col_expr ? col_expr->get_rte_idx() : -1;
3355 return makeExpr<Analyzer::Var>(
3356 expr->
get_type_info(), column_key, rte_idx, which_row, varno);
3361 bool expr_list_match(
const std::vector<std::shared_ptr<Analyzer::Expr>>& lhs,
3362 const std::vector<std::shared_ptr<Analyzer::Expr>>& rhs);
3365 std::shared_ptr<Analyzer::Expr>
remove_cast(
const std::shared_ptr<Analyzer::Expr>& expr);
getExpectedTypeFamilies()
DEVICE auto upper_bound(ARGS &&...args)
std::shared_ptr< Analyzer::Expr > arg
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::list< ExpressionPtr > ExpressionPtrList
GeoBinOper(const Geospatial::GeoBase::GeoOp op, const SQLTypeInfo &ti, const SQLTypeInfo &ti0, const SQLTypeInfo &ti1, const std::vector< std::shared_ptr< Analyzer::Expr >> &args0, const std::vector< std::shared_ptr< Analyzer::Expr >> &args1)
std::shared_ptr< Analyzer::Expr > arg
bool hasRangeModeFraming() const
CaseExpr(const SQLTypeInfo &ti, bool has_agg, const std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr >>> &w, std::shared_ptr< Analyzer::Expr > e)
InIntegerSet(const std::shared_ptr< const Analyzer::Expr > a, const std::vector< int64_t > &values, const bool not_null)
TryStringCastOper(const SQLTypeInfo &ti, const std::shared_ptr< Analyzer::Expr > &operand)
virtual void get_domain(DomainSet &domain_set) const
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
bool operator==(const Expr &rhs) const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
WindowFrame(SqlWindowFrameBoundType bound_type, const std::shared_ptr< Analyzer::Expr > bound_expr)
TargetEntry(const std::string &n, std::shared_ptr< Analyzer::Expr > e, bool u)
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
std::string toString() const override
bool isCurrentRowBound() const
UrlDecodeStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
const std::list< std::shared_ptr< Analyzer::Expr > > & get_value_list() const
TrimStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
float get_likelihood() const
size_t getMinArgs() const override
std::vector< Analyzer::Expr * > getChildExprs() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::shared_ptr< Analyzer::Expr > expr
virtual bool operator==(const Expr &rhs) const =0
std::string toString() const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
SqlWindowFunctionKind getKind() const
LowerStringOper(const std::shared_ptr< Analyzer::Expr > &operand)
std::vector< std::vector< std::shared_ptr< TargetEntry > > > & get_values_lists()
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
Expr(SQLTypes t, int d, int s, bool notnull)
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
std::vector< std::string > getArgNames() const override
ConcatStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
InValues(std::shared_ptr< Analyzer::Expr > a, const std::list< std::shared_ptr< Analyzer::Expr >> &l)
PositionStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
static bool simple_predicate_has_simple_cast(const std::shared_ptr< Analyzer::Expr > cast_operand, const std::shared_ptr< Analyzer::Expr > const_operand)
const Expr * get_partition_count() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
InitCapStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
bool hasNoneEncodedTextArg() const
Constant(const SQLTypeInfo &ti, bool n, Datum v)
const std::shared_ptr< Analyzer::Expr > get_own_arg() const
bool operator==(const Expr &rhs) const override
std::string toString() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
GeoConstant(std::unique_ptr< Geospatial::GeoBase > &&geo, const SQLTypeInfo &ti)
void get_domain(DomainSet &domain_set) const override
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::string toString() const final
bool operator==(const Expr &rhs) const override
bool is_constant_expr() const
const Expr * get_else_expr() const
const SQLTypeInfo getTypeInfo0() const
JarowinklerSimilarityStringOper(const std::shared_ptr< Analyzer::Expr > &left_operand, const std::shared_ptr< Analyzer::Expr > &right_operand)
std::shared_ptr< Analyzer::Expr > deep_copy() const override
bool operator==(const Expr &rhs) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
bool hasTimestampTypeFrameBound() const
static std::vector< std::shared_ptr< Analyzer::Expr > > normalize_operands(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
void set_contains_agg(bool a)
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
Expr(SQLTypes t, bool notnull)
bool operator==(const Expr &rhs) const override
const std::vector< int64_t > & get_value_list() const
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
bool operator==(const Expr &rhs) const override
HashStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
void check_operand_types(const size_t min_args, const std::vector< OperandTypeFamily > &expected_type_families, const std::vector< std::string > &arg_names, const bool dict_encoded_cols_only=false, const bool cols_first_arg_only=true) const
bool isFrameNavigateWindowFunction() const
OrderEntry(int t, bool d, bool nf)
const Expr * get_escape_expr() const
virtual std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
size_t getMinArgs() const override
std::shared_ptr< Analyzer::Expr > arg
std::vector< std::vector< std::shared_ptr< TargetEntry > > > values_lists
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::shared_ptr< Analyzer::Expr > decompress()
std::optional< int > output_srid_override_
DatediffExpr(const SQLTypeInfo &ti, const DatetruncField f, const std::shared_ptr< Analyzer::Expr > start, const std::shared_ptr< Analyzer::Expr > end)
std::shared_ptr< Analyzer::Expr > remove_cast(const std::shared_ptr< Analyzer::Expr > &expr)
RangeOper(const bool l_inclusive, const bool r_inclusive, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
size_t getMinArgs() const override
ReplaceStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > &search_pattern, const std::shared_ptr< Analyzer::Expr > &replacing_str)
static bool colvar_comp(const ColumnVar *l, const ColumnVar *r)
bool isMissingValueFillingFunction() const
const std::shared_ptr< Analyzer::Expr > frame_end_bound_
const std::vector< std::vector< std::shared_ptr< TargetEntry > > > & get_values_lists() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
void add_rte(RangeTableEntry *rte)
getExpectedTypeFamilies()
const SQLTypeInfo getTypeInfo0() const
std::vector< std::string > getArgNames() const override
std::shared_ptr< Analyzer::Expr > operand
virtual void print() const
std::list< int > result_col_list
std::shared_ptr< Analyzer::Expr > deep_copy() const override
bool operator==(const Expr &rhs) const override
getExpectedTypeFamilies()
std::shared_ptr< Analyzer::Expr > arg
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr > > > expr_pair_list
const std::shared_ptr< Analyzer::Expr > get_own_arg() const
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
GeoUOper(const Geospatial::GeoBase::GeoOp op, const SQLTypeInfo &ti, const SQLTypeInfo &ti0, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
RegexpSubstrStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > ®ex_pattern, const std::shared_ptr< Analyzer::Expr > &start_pos, const std::shared_ptr< Analyzer::Expr > &occurrence, const std::shared_ptr< Analyzer::Expr > ®ex_params, const std::shared_ptr< Analyzer::Expr > &sub_match_group_idx)
bool hasAggregateTreeRequiredWindowFunc() const
bool operator==(const Expr &rhs) const override
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
getExpectedTypeFamilies()
std::shared_ptr< Analyzer::Expr > deep_copy() const override
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
const std::shared_ptr< Analyzer::Expr > get_own_arg() const
StringOper(const StringOper &other_string_oper)
void collect_rte_idx(std::set< int > &rte_idx_set) const final
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
bool operator==(const Expr &rhs) const override
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
getExpectedTypeFamilies()
virtual void add_unique(std::list< const Expr * > &expr_list) const
void collect_rte_idx(std::set< int > &rte_idx_set) const override
std::shared_ptr< Analyzer::Expr > right_operand
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
void collect_rte_idx(std::set< int > &rte_idx_set) const override
std::shared_ptr< Analyzer::Expr > escape_expr
const Query * get_parsetree() const
bool operator==(Expr const &rhs) const override
TryStringCastOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
std::vector< std::string > getArgNames() const override
getExpectedTypeFamilies()
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
void collect_rte_idx(std::set< int > &rte_idx_set) const override
getExpectedTypeFamilies()
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
const Expr * get_escape_expr() const
const Expr * get_right_operand() const
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
void collect_rte_idx(std::set< int > &rte_idx_set) const override
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::string toString() const override
std::shared_ptr< Analyzer::Expr > get_shared_ptr()
virtual void check_group_by(const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const
shared::ColumnKey column_key_
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
RepeatStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
auto getOutputSridOverride() const
Var(const SQLTypeInfo &ti, WhichRow o, int32_t v)
std::map< size_t, std::pair< SQLTypes, Datum >> LiteralArgMap
std::shared_ptr< Analyzer::Expr > deep_copy() const override
SqlWindowFrameBoundType bound_type_
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
std::list< std::shared_ptr< Analyzer::Expr > > group_by
MLPredictExpr(const std::shared_ptr< Analyzer::Expr > &model, const std::vector< std::shared_ptr< Analyzer::Expr >> ®ressors)
static bool isFramingAvailableWindowFunc(SqlWindowFunctionKind kind)
GeoColumnVar(const SQLTypeInfo &ti, const shared::ColumnKey &column_key, const int32_t range_table_index, const bool with_bounds)
std::shared_ptr< Analyzer::Expr > arg
std::shared_ptr< Analyzer::Expr > deep_copy() const override
getExpectedTypeFamilies()
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::vector< std::string > getArgNames() const override
std::shared_ptr< Analyzer::Expr > like_expr
void set_varno(int32_t n)
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
void collect_rte_idx(std::set< int > &rte_idx_set) const override
std::string toString() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Var > var_ref(const Analyzer::Expr *expr, const Analyzer::Var::WhichRow which_row, const int varno)
HashStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
std::vector< std::string > getArgNames() const override
const std::shared_ptr< const Analyzer::Expr > arg
const std::shared_ptr< Analyzer::Expr > get_own_operand() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
void cast_from_string(const SQLTypeInfo &new_type_info)
std::shared_ptr< Analyzer::Expr > deep_copy() const override
bool get_contains_agg() const
void check_group_by(const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const override
std::string toString() const override
std::shared_ptr< Analyzer::Expr > add_cast(const SQLTypeInfo &new_type_info) override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
size_t getMinArgs() const override
const SQLTypeInfo getTypeInfo1() const
std::shared_ptr< Analyzer::Expr > ExpressionPtr
const Geospatial::GeoBase::GeoOp op_
const Expr * get_arg() const
const std::vector< std::shared_ptr< Analyzer::Expr > > order_keys_
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
bool operator==(const Expr &rhs) const override
void set_order_by(std::list< OrderEntry > *o)
bool operator==(const Expr &rhs) const override
DatetruncField get_field() const
std::shared_ptr< Analyzer::Expr > model_value_
const std::list< OrderEntry > * get_order_by() const
static SqlStringOpKind get_and_validate_trim_op_kind(const SqlStringOpKind trim_op_kind_maybe, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
bool requiresPerRowTranslation() const
void set_result_col_list(const std::list< int > &col_list)
const Expr * get_arg() const
getExpectedTypeFamilies()
std::shared_ptr< Analyzer::Expr > upper_bound_
Constants for Builtin SQL Types supported by HEAVY.AI.
void set_which_row(WhichRow r)
size_t getMinArgs() const override
size_t getMinArgs() const override
std::shared_ptr< Analyzer::Expr > add_cast(const SQLTypeInfo &new_type_info) override
std::shared_ptr< Analyzer::Expr > arg
const Expr * get_where_predicate() const
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
RegexpReplaceStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > ®ex_pattern, const std::shared_ptr< Analyzer::Expr > &replacing_str, const std::shared_ptr< Analyzer::Expr > &start_pos, const std::shared_ptr< Analyzer::Expr > &occurrence, const std::shared_ptr< Analyzer::Expr > ®ex_params)
bool operator==(const Expr &rhs) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
virtual std::vector< OperandTypeFamily > getExpectedTypeFamilies() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
const Analyzer::WindowFrame * getFrameStartBound() const
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
const std::vector< std::shared_ptr< Analyzer::Expr > > partition_keys_
static std::vector< std::shared_ptr< Analyzer::Expr > > normalize_operands(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
void set_constant_expr() const
RegexpCountStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > ®ex_pattern, const std::shared_ptr< Analyzer::Expr > &start_pos, const std::shared_ptr< Analyzer::Expr > ®ex_params)
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
void collect_rte_idx(std::set< int > &rte_idx_set) const override
bool operator==(const Expr &rhs) const override
void set_offset(int64_t o)
ReplaceStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
StringOper(const SqlStringOpKind kind, const SQLTypeInfo &return_ti, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
UOper(SQLTypes t, SQLOps o, std::shared_ptr< Analyzer::Expr > p)
std::shared_ptr< Analyzer::Expr > getOwnArg(const size_t i) const
std::unique_ptr< Geospatial::GeoBase > geo_
getExpectedTypeFamilies()
size_t getLiteralsArity() const
std::shared_ptr< Analyzer::Expr > partition_count_
virtual std::vector< Analyzer::Expr * > getChildExprs() const
getExpectedTypeFamilies()
const Analyzer::WindowFrame * getFrameEndBound() const
std::string toString() const override
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
std::string toString() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
const std::vector< OrderEntry > & getCollation() const
const Expr * get_left_operand() const
EncodingType get_compression() const
std::list< const Expr * > DomainSet
virtual void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const
void set_constval(Datum d)
const Expr * get_arg() const
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::vector< std::string > getArgNames() const override
size_t getMinArgs() const override
std::enable_if< std::is_base_of< Analyzer::Expr, Tp >::value, std::shared_ptr< Tp > >::type makeExpr(Args &&...args)
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
std::string toString() const override
void check_group_by(const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const override
const std::string & get_resname() const
double get_bound_val(const Analyzer::Expr *bound_expr) const
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
RepeatStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
bool operator==(const Expr &rhs) const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
TrimStringOper(const SqlStringOpKind trim_op_kind, const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > &trim_chars)
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
int get_rte_idx(const std::string &range_var_name) const
void cast_string(const SQLTypeInfo &new_type_info)
getExpectedTypeFamilies()
void set_type_info(const SQLTypeInfo &ti)
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::string toString() const override
JsonValueStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
const std::shared_ptr< Analyzer::Expr > get_own_from_expr() const
std::vector< std::shared_ptr< Analyzer::Expr > > chained_string_op_exprs_
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::string toString() const override
size_t getMinArgs() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
LikelihoodExpr(std::shared_ptr< Analyzer::Expr > a, float l=0.5)
bool operator==(const Expr &rhs) const override
StringOper(const SqlStringOpKind kind, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
BinOper(const SQLTypeInfo &ti, bool has_agg, SQLOps o, SQLQualifier q, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
bool g_enable_string_functions
std::string toString() const override
std::vector< std::string > getArgNames() const override
std::vector< size_t > getLiteralArgIndexes() const
std::string toString() const override
LevenshteinDistanceStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::string toString() const override
bool get_calc_encoded_length() const
bool operator==(const Expr &rhs) const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::string toString() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::vector< OperandTypeFamily > getExpectedTypeFamilies() const override
const FrameBoundType frame_bound_type_
std::shared_ptr< Analyzer::Expr > deep_copy() const override
const Geospatial::GeoBase::GeoOp op_
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
std::string toString() const override
std::shared_ptr< Analyzer::Expr > rewrite_with_child_targetlist(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
SQLOps get_optype() const
std::shared_ptr< Analyzer::Expr > left_operand
bool operator==(const Expr &rhs) const override
bool skip_out_of_bound_check_
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
RepeatStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > &num_repeats)
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
std::string toString() const override
std::string toString() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
SqlWindowFrameBoundType getBoundType() const
const Query * get_next_query() const
SubstringStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > &start_pos, const std::shared_ptr< Analyzer::Expr > &length)
const std::shared_ptr< Analyzer::Expr > frame_start_bound_
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > normalize_simple_predicate(int &rte_idx) const override
const std::list< std::shared_ptr< Analyzer::Expr > > value_list
Base64EncodeStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
SplitPartStringOper(const std::shared_ptr< Analyzer::Expr > &operand, const std::shared_ptr< Analyzer::Expr > &delimiter, const std::shared_ptr< Analyzer::Expr > &split_index)
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
static SQLTypeInfo common_string_type(const SQLTypeInfo &type1, const SQLTypeInfo &type2)
std::shared_ptr< Analyzer::Expr > deep_copy() const override
void collect_rte_idx(std::set< int > &rte_idx_set) const override
UpperStringOper(const std::vector< std::shared_ptr< Analyzer::Expr >> &operands)
DatetruncExpr(const SQLTypeInfo &ti, bool has_agg, DatetruncField f, std::shared_ptr< Analyzer::Expr > e)
std::shared_ptr< Analyzer::Expr > right_operand_
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
void collect_column_var(std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
void set_fixed_encoding_null_val() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
static SqlStringOpKind validate_trim_op_kind(const SqlStringOpKind trim_op_kind)
bool hasSingleDictEncodedColInput() const
returns whether we have one and only one column involved in this StringOper and all its descendents...
std::shared_ptr< Analyzer::Expr > deep_copy() const override
RegexpReplaceStringOper(const std::shared_ptr< Analyzer::StringOper > &string_oper)
Expr(const SQLTypeInfo &ti, bool has_agg=false)
void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const final
LiteralArgMap getLiteralArgs() const
std::string toString() const override
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
std::vector< std::string > getArgNames() const override
UrlDecodeStringOper(const std::shared_ptr< Analyzer::Expr > &operand)
const DatetruncField field_
bool operator==(const Expr &rhs) const override
void group_predicates(std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getTuple() const
CONSTEXPR DEVICE bool is_null(const T &value)
const Expr * get_pc_dimension_value() const
void collect_rte_idx(std::set< int > &rte_idx_set) const override
std::shared_ptr< Analyzer::Expr > rewrite_agg_to_var(const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const