OmniSciDB
0264ff685a
|
#include <Analyzer.h>
Public Member Functions | |
Constant (SQLTypes t, bool n) | |
Constant (SQLTypes t, bool n, Datum v) | |
Constant (const SQLTypeInfo &ti, bool n, Datum v) | |
Constant (const SQLTypeInfo &ti, bool n, const std::list< std::shared_ptr< Analyzer::Expr >> &l) | |
~Constant () override | |
bool | get_is_null () const |
Datum | get_constval () const |
void | set_constval (Datum d) |
const std::list< std::shared_ptr< Analyzer::Expr > > & | get_value_list () const |
std::shared_ptr< Analyzer::Expr > | deep_copy () const override |
std::shared_ptr< Analyzer::Expr > | add_cast (const SQLTypeInfo &new_type_info) override |
bool | operator== (const Expr &rhs) const override |
std::string | toString () const override |
![]() | |
Expr (SQLTypes t, bool notnull) | |
Expr (SQLTypes t, int d, bool notnull) | |
Expr (SQLTypes t, int d, int s, bool notnull) | |
Expr (const SQLTypeInfo &ti, bool has_agg=false) | |
virtual | ~Expr () |
std::shared_ptr< Analyzer::Expr > | get_shared_ptr () |
const SQLTypeInfo & | get_type_info () const |
void | set_type_info (const SQLTypeInfo &ti) |
bool | get_contains_agg () const |
void | set_contains_agg (bool a) |
virtual void | check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const |
virtual std::shared_ptr< Analyzer::Expr > | normalize_simple_predicate (int &rte_idx) const |
virtual void | group_predicates (std::list< const Expr *> &scan_predicates, std::list< const Expr *> &join_predicates, std::list< const Expr *> &const_predicates) const |
virtual void | collect_rte_idx (std::set< int > &rte_idx_set) const |
virtual void | collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const |
virtual std::shared_ptr< Analyzer::Expr > | rewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const |
virtual std::shared_ptr< Analyzer::Expr > | rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const |
virtual std::shared_ptr< Analyzer::Expr > | rewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const |
virtual void | print () const |
virtual void | add_unique (std::list< const Expr *> &expr_list) const |
virtual void | find_expr (bool(*f)(const Expr *), std::list< const Expr *> &expr_list) const |
std::shared_ptr< Analyzer::Expr > | decompress () |
virtual void | get_domain (DomainSet &domain_set) const |
Private Member Functions | |
void | cast_number (const SQLTypeInfo &new_type_info) |
void | cast_string (const SQLTypeInfo &new_type_info) |
void | cast_from_string (const SQLTypeInfo &new_type_info) |
void | cast_to_string (const SQLTypeInfo &new_type_info) |
void | do_cast (const SQLTypeInfo &new_type_info) |
void | set_null_value () |
Private Attributes | |
bool | is_null |
Datum | constval |
const std::list< std::shared_ptr< Analyzer::Expr > > | value_list |
Additional Inherited Members | |
![]() | |
SQLTypeInfo | type_info |
bool | contains_agg |
Definition at line 306 of file Analyzer.h.
|
inline |
Definition at line 308 of file Analyzer.h.
Referenced by Analyzer::Expr::add_cast().
Definition at line 315 of file Analyzer.h.
|
inline |
Definition at line 322 of file Analyzer.h.
|
inline |
Definition at line 329 of file Analyzer.h.
|
override |
Definition at line 39 of file Analyzer.cpp.
References constval, SQLTypeInfo::is_geometry(), is_null, SQLTypeInfo::is_string(), Datum::stringval, and Analyzer::Expr::type_info.
|
overridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 1259 of file Analyzer.cpp.
References Analyzer::Expr::add_cast(), Analyzer::Expr::contains_agg, do_cast(), SQLTypeInfo::get_compression(), SQLTypeInfo::is_date(), SQLTypeInfo::is_decimal(), SQLTypeInfo::is_fp(), SQLTypeInfo::is_integer(), is_null, SQLTypeInfo::is_time(), kCAST, kENCODING_DATE_IN_DAYS, kENCODING_NONE, SQLTypeInfo::set_compression(), set_null_value(), and Analyzer::Expr::type_info.
|
private |
Definition at line 1061 of file Analyzer.cpp.
References constval, StringToDatum(), Datum::stringval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
private |
Definition at line 755 of file Analyzer.cpp.
References Datum::bigintval, Datum::boolval, CHECK, constval, convert_decimal_value_to_scale(), Analyzer::anonymous_namespace{Analyzer.cpp}::decimal_to_int_frac(), Datum::doubleval, Datum::floatval, SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), Datum::intval, kBIGINT, kBOOLEAN, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTIMESTAMP, kTINYINT, Datum::smallintval, Datum::tinyintval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
private |
Definition at line 1050 of file Analyzer.cpp.
References constval, SQLTypeInfo::get_dimension(), SQLTypeInfo::get_type(), kTEXT, Datum::stringval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
private |
Definition at line 1069 of file Analyzer.cpp.
References constval, DatumToString(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_type(), kTEXT, Datum::stringval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 82 of file Analyzer.cpp.
References constval, SQLTypeInfo::get_type(), SQLTypeInfo::is_geometry(), is_null, SQLTypeInfo::is_string(), kARRAY, Datum::stringval, Analyzer::Expr::type_info, and value_list.
Referenced by Analyzer::BinOper::normalize_simple_predicate(), and DeepCopyVisitor::visitConstant().
|
private |
Definition at line 1130 of file Analyzer.cpp.
References Datum::bigintval, cast_from_string(), cast_number(), cast_string(), cast_to_string(), CHECK, constval, DateTruncate(), DateTruncateHighPrecisionToDate(), dtDAY, DateTimeUtils::get_datetime_scaled_epoch(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_elem_type(), get_is_null(), SQLTypeInfo::get_notnull(), get_nullable_type_info(), DateTimeUtils::get_timestamp_precision_scale(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), SQLTypeInfo::is_array(), SQLTypeInfo::is_boolean(), SQLTypeInfo::is_geometry(), SQLTypeInfo::is_high_precision_timestamp(), is_null, Analyzer::anonymous_namespace{Analyzer.cpp}::is_null_value(), SQLTypeInfo::is_number(), SQLTypeInfo::is_string(), SQLTypeInfo::is_time(), kBOOLEAN, kDATE, kTIMESTAMP, kVARCHAR, DateTimeUtils::ScaleDown, DateTimeUtils::ScaleUp, set_null_value(), Analyzer::Expr::type_info, and value_list.
Referenced by add_cast().
|
inline |
Definition at line 335 of file Analyzer.h.
Referenced by CodeGenerator::codegen(), CodeGenerator::codegenDictLike(), CodeGenerator::codegenDictRegexp(), CodeGenerator::codegenDictStrCmp(), CodeGenerator::codegenIntConst(), anonymous_namespace{LogicalIR.cpp}::contains_unsafe_division(), Parser::InsertValuesStmt::determineLeafIndex(), Parser::LikeExpr::get(), Parser::RegexpExpr::get(), getExpressionRange(), CgenState::getOrAddLiteral(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), operator==(), ScalarExprToSql::visitConstant(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitUOper().
|
inline |
Definition at line 334 of file Analyzer.h.
References is_null().
Referenced by CodeGenerator::codegen(), CodeGenerator::codegenIntConst(), Parser::InsertValuesStmt::determineLeafIndex(), do_cast(), Parser::anonymous_namespace{ParserNode.cpp}::expr_is_null(), getExpressionRange(), CgenState::getOrAddLiteral(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), Analyzer::anonymous_namespace{Analyzer.cpp}::is_expr_nullable(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_else_null(), operator==(), and ScalarExprToSql::visitConstant().
|
inline |
Definition at line 337 of file Analyzer.h.
References operator==(), and toString().
Referenced by CgenState::getOrAddLiteral().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2101 of file Analyzer.cpp.
References Analyzer::Datum_equal(), get_constval(), get_is_null(), Analyzer::Expr::get_type_info(), SQLTypeInfo::is_array(), is_null(), and Analyzer::Expr::type_info.
|
inline |
Definition at line 336 of file Analyzer.h.
|
private |
Definition at line 1207 of file Analyzer.cpp.
References Datum::arrayval, Datum::bigintval, Datum::boolval, CHECK, constval, Datum::doubleval, Datum::floatval, SQLTypeInfo::get_type(), Datum::intval, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kLINESTRING, kMULTIPOLYGON, kNULLT, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, NULL_BIGINT, NULL_BOOLEAN, NULL_DOUBLE, NULL_FLOAT, NULL_INT, NULL_SMALLINT, NULL_TINYINT, Datum::smallintval, Datum::stringval, Datum::tinyintval, and Analyzer::Expr::type_info.
Referenced by add_cast(), and do_cast().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2423 of file Analyzer.cpp.
References DatumToString(), SQLTypeInfo::get_elem_type(), SQLTypeInfo::get_type(), SQLTypeInfo::is_array(), is_null(), Analyzer::InIntegerSet::toString(), and Analyzer::Expr::type_info.
|
private |
Definition at line 347 of file Analyzer.h.
Referenced by cast_from_string(), cast_number(), cast_string(), cast_to_string(), deep_copy(), do_cast(), set_null_value(), and ~Constant().
|
private |
Definition at line 346 of file Analyzer.h.
Referenced by add_cast(), deep_copy(), do_cast(), omnisci.thrift.ttypes.TDatum::read(), omnisci.thrift.ttypes.TStringValue::read(), omnisci.thrift.ttypes.TVarLen::read(), omnisci.thrift.ttypes.TDatum::write(), omnisci.thrift.ttypes.TStringValue::write(), omnisci.thrift.ttypes.TVarLen::write(), and ~Constant().
|
private |
Definition at line 348 of file Analyzer.h.
Referenced by deep_copy(), Analyzer::InValues::deep_copy(), and do_cast().