OmniSciDB
a5dc49c757
|
#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 |
Public Member Functions inherited from Analyzer::Expr | |
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 size_t | get_num_column_vars (const 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 (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const |
std::shared_ptr< Analyzer::Expr > | decompress () |
virtual void | get_domain (DomainSet &domain_set) const |
Protected 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 () |
Protected Attributes | |
bool | is_null |
Datum | constval |
const std::list < std::shared_ptr < Analyzer::Expr > > | value_list |
Protected Attributes inherited from Analyzer::Expr | |
SQLTypeInfo | type_info |
bool | contains_agg |
Definition at line 319 of file Analyzer.h.
|
inline |
Definition at line 321 of file Analyzer.h.
References SQLTypeInfo::set_notnull(), set_null_value(), and Analyzer::Expr::type_info.
Definition at line 328 of file Analyzer.h.
References SQLTypeInfo::set_notnull(), set_null_value(), and Analyzer::Expr::type_info.
|
inline |
Definition at line 335 of file Analyzer.h.
References SQLTypeInfo::set_notnull(), set_null_value(), and Analyzer::Expr::type_info.
|
inline |
Definition at line 342 of file Analyzer.h.
|
override |
Definition at line 40 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 1416 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.
|
protected |
Definition at line 1208 of file Analyzer.cpp.
References constval, StringToDatum(), Datum::stringval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
protected |
Definition at line 922 of file Analyzer.cpp.
References Datum::bigintval, Datum::boolval, CHECK, constval, convert_decimal_value_to_scale(), Datum::doubleval, Datum::floatval, SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), Datum::intval, kBIGINT, kBOOLEAN, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTIMESTAMP, kTINYINT, Analyzer::anonymous_namespace{Analyzer.cpp}::safeScale(), Datum::smallintval, Datum::tinyintval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
protected |
Definition at line 1197 of file Analyzer.cpp.
References constval, SQLTypeInfo::get_dimension(), SQLTypeInfo::get_type(), kTEXT, Datum::stringval, and Analyzer::Expr::type_info.
Referenced by do_cast().
|
protected |
Definition at line 1216 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 91 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 DeepCopyVisitor::visitConstant().
|
protected |
Definition at line 1281 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_any(), 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(), SQLTypeInfo::is_timestamp(), kBOOLEAN, kDATE, kTIME, kTIMESTAMP, kVARCHAR, DateTimeUtils::ScaleDown, DateTimeUtils::ScaleUp, set_null_value(), Analyzer::Expr::type_info, and value_list.
Referenced by add_cast().
|
inline |
Definition at line 348 of file Analyzer.h.
References constval.
Referenced by Executor::canSkipFragmentForFpQual(), CodeGenerator::codegen(), CodeGenerator::codegenDictLike(), CodeGenerator::codegenDictRegexp(), CodeGenerator::codegenDictStrCmp(), CodeGenerator::codegenIntConst(), anonymous_namespace{LogicalIR.cpp}::contains_unsafe_division(), anonymous_namespace{RelAlgTranslator.cpp}::determineTimeUnit(), anonymous_namespace{RelAlgTranslator.cpp}::determineTimeValMultiplierForTimeType(), Parser::LikeExpr::get(), Parser::RegexpExpr::get(), Analyzer::WidthBucketExpr::get_partition_count_val(), getExpressionRange(), CgenState::getOrAddLiteral(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), operator==(), ScalarExprToSql::visitConstant(), TransientStringLiteralsVisitor::visitConstant(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitUOper().
|
inline |
Definition at line 347 of file Analyzer.h.
References is_null.
Referenced by CodeGenerator::codegen(), CodeGenerator::codegenIntConst(), 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==(), ScalarExprToSql::visitConstant(), and TransientStringLiteralsVisitor::visitConstant().
|
inline |
Definition at line 350 of file Analyzer.h.
References value_list.
Referenced by CgenState::getOrAddLiteral().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2334 of file Analyzer.cpp.
References constval, Analyzer::Datum_equal(), get_constval(), get_is_null(), Analyzer::Expr::get_type_info(), SQLTypeInfo::is_array(), is_null, and Analyzer::Expr::type_info.
|
inline |
|
protected |
Definition at line 1362 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, kMULTILINESTRING, kMULTIPOINT, 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(), Constant(), and do_cast().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2741 of file Analyzer.cpp.
References constval, DatumToString(), SQLTypeInfo::get_elem_type(), SQLTypeInfo::get_type(), SQLTypeInfo::is_array(), is_null, and Analyzer::Expr::type_info.
|
protected |
Definition at line 360 of file Analyzer.h.
Referenced by cast_from_string(), cast_number(), cast_string(), cast_to_string(), deep_copy(), do_cast(), get_constval(), operator==(), set_constval(), set_null_value(), toString(), and ~Constant().
|
protected |
Definition at line 359 of file Analyzer.h.
Referenced by add_cast(), deep_copy(), do_cast(), get_is_null(), operator==(), heavydb.thrift.ttypes.TDatum::read(), heavydb.thrift.ttypes.TStringValue::read(), heavydb.thrift.ttypes.TVarLen::read(), toString(), heavydb.thrift.ttypes.TDatum::write(), heavydb.thrift.ttypes.TStringValue::write(), heavydb.thrift.ttypes.TVarLen::write(), and ~Constant().
|
protected |
Definition at line 361 of file Analyzer.h.
Referenced by deep_copy(), do_cast(), and get_value_list().