OmniSciDB
a5dc49c757
|
#include <Analyzer.h>
Public Member Functions | |
BinOper (const SQLTypeInfo &ti, bool has_agg, SQLOps o, SQLQualifier q, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r) | |
BinOper (SQLTypes t, SQLOps o, SQLQualifier q, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r) | |
SQLOps | get_optype () const |
bool | is_bbox_intersect_oper () const |
SQLQualifier | get_qualifier () const |
const Expr * | get_left_operand () const |
const Expr * | get_right_operand () const |
const std::shared_ptr < Analyzer::Expr > | get_own_left_operand () const |
const std::shared_ptr < Analyzer::Expr > | get_own_right_operand () const |
void | check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const override |
std::shared_ptr< Analyzer::Expr > | deep_copy () const override |
std::shared_ptr< Analyzer::Expr > | normalize_simple_predicate (int &rte_idx) 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 |
void | collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) 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 > | rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override |
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 |
std::string | toString () const override |
void | find_expr (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) 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 std::shared_ptr < Analyzer::Expr > | add_cast (const SQLTypeInfo &new_type_info) |
virtual size_t | get_num_column_vars (const bool include_agg) const |
virtual void | print () const |
virtual void | add_unique (std::list< const Expr * > &expr_list) const |
std::shared_ptr< Analyzer::Expr > | decompress () |
virtual void | get_domain (DomainSet &domain_set) const |
Static Public Member Functions | |
static SQLTypeInfo | analyze_type_info (SQLOps op, const SQLTypeInfo &left_type, const SQLTypeInfo &right_type, SQLTypeInfo *new_left_type, SQLTypeInfo *new_right_type) |
static SQLTypeInfo | common_numeric_type (const SQLTypeInfo &type1, const SQLTypeInfo &type2) |
static SQLTypeInfo | common_string_type (const SQLTypeInfo &type1, const SQLTypeInfo &type2) |
static bool | simple_predicate_has_simple_cast (const std::shared_ptr< Analyzer::Expr > cast_operand, const std::shared_ptr< Analyzer::Expr > const_operand) |
Private Attributes | |
SQLOps | optype |
SQLQualifier | qualifier |
std::shared_ptr< Analyzer::Expr > | left_operand |
std::shared_ptr< Analyzer::Expr > | right_operand |
Additional Inherited Members | |
Protected Attributes inherited from Analyzer::Expr | |
SQLTypeInfo | type_info |
bool | contains_agg |
Definition at line 433 of file Analyzer.h.
|
inline |
Definition at line 435 of file Analyzer.h.
|
inline |
Definition at line 442 of file Analyzer.h.
|
static |
Definition at line 267 of file Analyzer.cpp.
References CHECK, common_numeric_type(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), IS_ARITHMETIC, SQLTypeInfo::is_boolean(), IS_COMPARISON, SQLTypeInfo::is_decimal(), SQLTypeInfo::is_integer(), IS_LOGIC, SQLTypeInfo::is_number(), SQLTypeInfo::is_string(), SQLTypeInfo::is_time(), SQLTypeInfo::is_timeinterval(), kBOOLEAN, kDATE, kMINUS, kMODULO, kMULTIPLY, kPLUS, kTIME, kTIMESTAMP, SQLTypeInfo::set_dimension(), SQLTypeInfo::set_notnull(), and SQLTypeInfo::set_scale().
Referenced by Parser::BetweenExpr::analyze(), and Parser::OperExpr::normalize().
|
overridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 1538 of file Analyzer.cpp.
References left_operand, and right_operand.
|
inlineoverridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 483 of file Analyzer.h.
References left_operand, and right_operand.
|
inlineoverridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 479 of file Analyzer.h.
References left_operand, and right_operand.
|
static |
Definition at line 500 of file Analyzer.cpp.
References CHECK, SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), SQLTypeInfo::is_boolean(), SQLTypeInfo::is_number(), SQLTypeInfo::is_timeinterval(), kBIGINT, kDECIMAL, kDOUBLE, kFLOAT, kINT, sql_constants::kMaxRepresentableNumericPrecision, kNUMERIC, kSMALLINT, kTINYINT, and SQLTypeInfo::set_fixed_size().
Referenced by Parser::InValues::analyze(), analyze_type_info(), and Parser::CaseExpr::normalize().
|
static |
Definition at line 452 of file Analyzer.cpp.
References CHECK, shared::StringDictKey::dict_id, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_type(), SQLTypeInfo::getStringDictKey(), Analyzer::anonymous_namespace{Analyzer.cpp}::has_same_dict(), SQLTypeInfo::is_dict_encoded_string(), SQLTypeInfo::is_string(), kENCODING_DICT, kENCODING_NONE, kNULLT, kTEXT, kVARCHAR, and SQLTypeInfo::setStringDictKey().
Referenced by Parser::InValues::analyze().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 106 of file Analyzer.cpp.
References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.
Referenced by normalize_simple_predicate().
|
overridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 3258 of file Analyzer.cpp.
References Analyzer::Expr::add_unique(), f(), left_operand, and right_operand.
|
inline |
Definition at line 455 of file Analyzer.h.
References left_operand.
Referenced by anonymous_namespace{CompareIR.cpp}::check_array_comp_cond(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenArith(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDeciDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), anonymous_namespace{PerfectJoinHashTable.cpp}::get_cols(), anonymous_namespace{HashJoin.cpp}::get_cols(), anonymous_namespace{LogicalIR.cpp}::get_likelihood(), anonymous_namespace{LogicalIR.cpp}::get_weight(), getExpressionRange(), CodeGenerator::hashJoinLhsTuple(), RelAlgExecutor::isRowidLookup(), anonymous_namespace{CompareIR.cpp}::lower_multicol_compare(), HashJoin::normalizeColumnPairs(), QueryPlanDagExtractor::normalizeColumnsPair(), operator==(), Executor::skipFragment(), ScalarExprToSql::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), DeepCopyVisitor::visitBinOper(), ScalarExprVisitor< std::set< shared::TableKey > >::visitBinOper(), TextEncodingCastCountVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().
|
inline |
Definition at line 452 of file Analyzer.h.
References optype.
Referenced by Executor::canSkipFragmentForFpQual(), anonymous_namespace{CompareIR.cpp}::check_array_comp_cond(), CodeGenerator::codegen(), CodeGenerator::codegenArith(), CodeGenerator::codegenCmp(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), CodeGenerator::getArithWithOverflowIntrinsic(), getExpressionRange(), anonymous_namespace{CompareIR.cpp}::lower_multicol_compare(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_gt_bigint_zero(), operator==(), ScalarExprToSql::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), DeepCopyVisitor::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), TextEncodingCastCountVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().
|
inline |
Definition at line 457 of file Analyzer.h.
References left_operand.
Referenced by CodeGenerator::codegenCmp(), anonymous_namespace{CompareIR.cpp}::lower_bw_eq(), anonymous_namespace{FromTableReordering.cpp}::traverse_join_cost_graph(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().
|
inline |
Definition at line 460 of file Analyzer.h.
References right_operand.
Referenced by CodeGenerator::codegenCmp(), anonymous_namespace{CompareIR.cpp}::lower_bw_eq(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().
|
inline |
Definition at line 454 of file Analyzer.h.
References qualifier.
Referenced by CodeGenerator::codegenCmp(), anonymous_namespace{LogicalIR.cpp}::is_qualified_bin_oper(), anonymous_namespace{CompareIR.cpp}::lower_bw_eq(), DeepCopyVisitor::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().
|
inline |
Definition at line 456 of file Analyzer.h.
References right_operand.
Referenced by anonymous_namespace{CompareIR.cpp}::check_array_comp_cond(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenArith(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDeciDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), anonymous_namespace{LogicalIR.cpp}::contains_unsafe_division(), anonymous_namespace{PerfectJoinHashTable.cpp}::get_cols(), anonymous_namespace{HashJoin.cpp}::get_cols(), getExpressionRange(), CodeGenerator::hashJoinLhsTuple(), anonymous_namespace{CompareIR.cpp}::lower_multicol_compare(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_gt_bigint_zero(), HashJoin::normalizeColumnPairs(), QueryPlanDagExtractor::normalizeColumnsPair(), operator==(), anonymous_namespace{LogicalIR.cpp}::should_defer_eval(), ScalarExprToSql::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), DeepCopyVisitor::visitBinOper(), ScalarExprVisitor< std::set< shared::TableKey > >::visitBinOper(), and TextEncodingCastCountVisitor::visitBinOper().
|
overridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 1642 of file Analyzer.cpp.
References kAND, left_operand, optype, and right_operand.
|
inline |
Definition at line 453 of file Analyzer.h.
References kBBOX_INTERSECT, and optype.
Referenced by HashJoin::normalizeColumnPairs(), and QueryPlanDagExtractor::normalizeColumnsPair().
|
overridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 1577 of file Analyzer.cpp.
References COMMUTE_COMPARISON, Analyzer::Expr::contains_agg, deep_copy(), Analyzer::ColumnVar::get_rte_idx(), IS_COMPARISON, kONE, left_operand, optype, qualifier, right_operand, simple_predicate_has_simple_cast(), and Analyzer::Expr::type_info.
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2359 of file Analyzer.cpp.
References get_left_operand(), get_optype(), get_right_operand(), left_operand, optype, and right_operand.
|
inlineoverridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 508 of file Analyzer.h.
References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.
|
inlineoverridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 499 of file Analyzer.h.
References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.
|
inlineoverridevirtual |
Reimplemented from Analyzer::Expr.
Definition at line 490 of file Analyzer.h.
References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.
|
static |
Definition at line 1553 of file Analyzer.cpp.
References Analyzer::Expr::get_type_info(), and kCAST.
Referenced by normalize_simple_predicate().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2786 of file Analyzer.cpp.
References kALL, kAND, kANY, kARRAY_AT, kBBOX_INTERSECT, kDIVIDE, kEQ, kGE, kGT, kLE, kLT, kMINUS, kMODULO, kMULTIPLY, kNE, kOR, kPLUS, left_operand, optype, qualifier, and right_operand.
Referenced by CodeGenerator::getArithWithOverflowIntrinsic().
|
private |
Definition at line 529 of file Analyzer.h.
Referenced by check_group_by(), collect_column_var(), collect_rte_idx(), deep_copy(), find_expr(), get_left_operand(), get_own_left_operand(), group_predicates(), normalize_simple_predicate(), operator==(), rewrite_agg_to_var(), rewrite_with_child_targetlist(), rewrite_with_targetlist(), and toString().
|
private |
Definition at line 526 of file Analyzer.h.
Referenced by deep_copy(), get_optype(), group_predicates(), is_bbox_intersect_oper(), normalize_simple_predicate(), operator==(), rewrite_agg_to_var(), rewrite_with_child_targetlist(), rewrite_with_targetlist(), and toString().
|
private |
Definition at line 527 of file Analyzer.h.
Referenced by deep_copy(), get_qualifier(), normalize_simple_predicate(), rewrite_agg_to_var(), rewrite_with_child_targetlist(), rewrite_with_targetlist(), and toString().
|
private |
Definition at line 530 of file Analyzer.h.
Referenced by check_group_by(), collect_column_var(), collect_rte_idx(), deep_copy(), find_expr(), get_own_right_operand(), get_right_operand(), group_predicates(), normalize_simple_predicate(), operator==(), rewrite_agg_to_var(), rewrite_with_child_targetlist(), rewrite_with_targetlist(), and toString().