21 using RetType = std::shared_ptr<Analyzer::Expr>;
59 std::list<RetType> new_list;
60 for (
const auto& in_value : value_list) {
61 new_list.push_back(
visit(in_value.get()));
63 return makeExpr<Analyzer::InValues>(
visit(in_values->
get_arg()), new_list);
67 return makeExpr<Analyzer::InIntegerSet>(
74 return makeExpr<Analyzer::CharLengthExpr>(
visit(char_length->
get_arg()),
79 return makeExpr<Analyzer::KeyForStringExpr>(
visit(expr->
get_arg()));
83 return makeExpr<Analyzer::SampleRatioExpr>(
visit(expr->
get_arg()));
95 return makeExpr<Analyzer::CardinalityExpr>(
visit(cardinality->
get_arg()));
100 return makeExpr<Analyzer::LikeExpr>(
visit(like->
get_arg()),
102 escape_expr ?
visit(escape_expr) :
nullptr,
109 return makeExpr<Analyzer::RegexpExpr>(
visit(regexp->
get_arg()),
111 escape_expr ?
visit(escape_expr) :
nullptr);
116 return makeExpr<Analyzer::WidthBucketExpr>(
124 std::list<std::pair<RetType, RetType>> new_list;
126 new_list.emplace_back(
visit(p.first.get()),
visit(p.second.get()));
129 return makeExpr<Analyzer::CaseExpr>(
133 else_expr ==
nullptr ?
nullptr :
visit(else_expr));
137 return makeExpr<Analyzer::DatetruncExpr>(datetrunc->
get_type_info(),
144 return makeExpr<Analyzer::ExtractExpr>(extract->
get_type_info(),
151 std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
156 return makeExpr<Analyzer::ArrayExpr>(
161 std::vector<std::shared_ptr<Analyzer::Expr>> args0_copy;
162 for (
const auto& arg : geo_expr->
getArgs0()) {
163 args0_copy.push_back(
visit(arg.get()));
167 return makeExpr<Analyzer::GeoUOper>(geo_expr->
getOp(), type_info, ti0, args0_copy);
171 std::vector<std::shared_ptr<Analyzer::Expr>> args0_copy;
172 for (
const auto& arg : geo_expr->
getArgs0()) {
173 args0_copy.push_back(
visit(arg.get()));
175 std::vector<std::shared_ptr<Analyzer::Expr>> args1_copy;
176 for (
const auto& arg : geo_expr->
getArgs1()) {
177 args1_copy.push_back(
visit(arg.get()));
182 return makeExpr<Analyzer::GeoBinOper>(
183 geo_expr->
getOp(), type_info, ti0, ti1, args0_copy, args1_copy);
188 std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
189 for (
const auto& arg : window_func->
getArgs()) {
190 args_copy.push_back(
visit(arg.get()));
192 std::vector<std::shared_ptr<Analyzer::Expr>> partition_keys_copy;
194 partition_keys_copy.push_back(
visit(partition_key.get()));
196 std::vector<std::shared_ptr<Analyzer::Expr>> order_keys_copy;
197 for (
const auto& order_key : window_func->
getOrderKeys()) {
198 order_keys_copy.push_back(
visit(order_key.get()));
201 return makeExpr<Analyzer::WindowFunction>(
218 std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
219 for (
size_t i = 0; i < func_oper->
getArity(); ++i) {
223 return makeExpr<Analyzer::FunctionOper>(type_info, func_oper->
getName(), args_copy);
227 return makeExpr<Analyzer::DatediffExpr>(datediff->
get_type_info(),
234 return makeExpr<Analyzer::DateaddExpr>(dateadd->
get_type_info(),
242 std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
243 for (
size_t i = 0; i < func_oper->
getArity(); ++i) {
247 return makeExpr<Analyzer::FunctionOperWithCustomTypeHandling>(
248 type_info, func_oper->
getName(), args_copy);
252 return makeExpr<Analyzer::LikelihoodExpr>(
visit(likelihood->
get_arg()),
266 return makeExpr<Analyzer::OffsetInFragment>();
RetType visitColumnVarTuple(const Analyzer::ExpressionTuple *col_var_tuple) const override
RetType visitInValues(const Analyzer::InValues *in_values) const override
float get_likelihood() const
SqlWindowFunctionKind getKind() const
const Expr * get_partition_count() const
RetType visitPCAProject(const Analyzer::PCAProjectExpr *expr) const override
const Expr * get_else_expr() const
const SQLTypeInfo getTypeInfo0() const
RetType visitVar(const Analyzer::Var *var) const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
const std::vector< int64_t > & get_value_list() const
const Expr * get_escape_expr() const
const SQLTypeInfo getTypeInfo0() const
RetType visitFunctionOper(const Analyzer::FunctionOper *func_oper) const override
RetType visitConstant(const Analyzer::Constant *constant) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
const Expr * get_escape_expr() const
const Expr * get_right_operand() const
RetType visitDatetruncExpr(const Analyzer::DatetruncExpr *datetrunc) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
RetType visitArrayOper(const Analyzer::ArrayExpr *array_expr) const override
bool get_contains_agg() const
RetType visitWidthBucket(const Analyzer::WidthBucketExpr *width_bucket_expr) const override
const SQLTypeInfo getTypeInfo1() const
const Expr * get_arg() const
DatetruncField get_field() const
const Expr * get_arg() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
const Analyzer::WindowFrame * getFrameStartBound() const
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Analyzer::WindowFrame * getFrameEndBound() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
const std::vector< OrderEntry > & getCollation() const
std::shared_ptr< Analyzer::Expr > RetType
const Expr * get_arg() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
bool get_calc_encoded_length() const
RetType visitGeoUOper(const Analyzer::GeoUOper *geo_expr) const override
SQLOps get_optype() const
RetType visitLikeExpr(const Analyzer::LikeExpr *like) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
RetType visitOffsetInFragment(const Analyzer::OffsetInFragment *) const override
RetType visitExtractExpr(const Analyzer::ExtractExpr *extract) const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
RetType visitCardinality(const Analyzer::CardinalityExpr *cardinality) const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
std::shared_ptr< Analyzer::Expr > deep_copy() const override
RetType visitLikelihood(const Analyzer::LikelihoodExpr *likelihood) const override
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
RetType visitKeyForString(const Analyzer::KeyForStringExpr *expr) const override
RetType visitAggExpr(const Analyzer::AggExpr *agg) const override
RetType visitFunctionOperWithCustomTypeHandling(const Analyzer::FunctionOperWithCustomTypeHandling *func_oper) const override
bool get_is_simple() const
bool get_is_distinct() const
const Expr * get_start_expr() const
const SQLTypeInfo & get_type_info() const
size_t getElementCount() const
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int32_t char_length(const char *str, const int32_t str_len)
std::shared_ptr< Analyzer::Expr > get_arg1() const
const Expr * get_pattern_expr() const
Expression class for string functions The "arg" constructor parameter must be an expression that reso...
const Expr * get_from_expr() const
RetType visitMLPredict(const Analyzer::MLPredictExpr *expr) const override
const Expr * get_datetime_expr() const
bool isLocalAlloc() const
const Expr * get_like_expr() const
const Analyzer::Expr * getArg(const size_t i) const
RetType visitUOper(const Analyzer::UOper *uoper) const override
const Expr * get_operand() const
const Expr * get_arg() const
RetType visitCharLength(const Analyzer::CharLengthExpr *char_length) const override
const Expr * get_arg() const
const std::list< std::shared_ptr< Analyzer::Expr > > & get_value_list() const
virtual std::shared_ptr< Analyzer::Expr > deep_copy() const =0
DateaddField get_field() const
SQLAgg get_aggtype() const
const Expr * get_target_value() const
const Expr * get_arg() const
const Expr * get_end_expr() const
Geospatial::GeoBase::GeoOp getOp() const
Analyzer::WindowFunction::FrameBoundType getFrameBoundType() const
RetType visitStringOper(const Analyzer::StringOper *string_oper) const override
RetType visitCaseExpr(const Analyzer::CaseExpr *case_expr) const override
const Expr * get_left_operand() const
RetType visitInIntegerSet(const Analyzer::InIntegerSet *in_integer_set) const override
RetType visitSampleRatio(const Analyzer::SampleRatioExpr *expr) const override
RetType visitBinOper(const Analyzer::BinOper *bin_oper) const override
RetType visitGeoExpr(const Analyzer::GeoExpr *geo_expr) const override
RetType visitRegexpExpr(const Analyzer::RegexpExpr *regexp) const override
const Expr * get_lower_bound() const
std::string getName() const
RetType visitDatediffExpr(const Analyzer::DatediffExpr *datediff) const override
const Expr * get_arg() const
HOST DEVICE bool get_notnull() const
const Expr * get_upper_bound() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getPartitionKeys() const
const Expr * get_arg() const
RetType visitGeoBinOper(const Analyzer::GeoBinOper *geo_expr) const override
DatetruncField get_field() const
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Geospatial::GeoBase::GeoOp getOp() const
const Expr * get_arg() const
RetType visitDateaddExpr(const Analyzer::DateaddExpr *dateadd) const override
SQLOps get_optype() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs1() const
const std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr > > > & get_expr_pair_list() const
RetType visitWindowFunction(const Analyzer::WindowFunction *window_func) const override
const Expr * get_number_expr() const
bool get_is_ilike() const
const Analyzer::Expr * getElement(const size_t i) const
SQLQualifier get_qualifier() const
RetType visitColumnVar(const Analyzer::ColumnVar *col_var) const override
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int32_t width_bucket_expr(const double target_value, const bool reversed, const double lower_bound, const double upper_bound, const int32_t partition_count)