OmniSciDB
a5dc49c757
|
#include <QueryRewrite.h>
Public Member Functions | |
QueryRewriter (const std::vector< InputTableInfo > &query_infos, Executor *executor) | |
RelAlgExecutionUnit | rewrite (const RelAlgExecutionUnit &ra_exe_unit_in) const |
RelAlgExecutionUnit | rewriteColumnarUpdate (const RelAlgExecutionUnit &ra_exe_unit_in, std::shared_ptr< Analyzer::ColumnVar > column_to_update) const |
RelAlgExecutionUnit | rewriteColumnarDelete (const RelAlgExecutionUnit &ra_exe_unit_in, std::shared_ptr< Analyzer::ColumnVar > delete_column) const |
RelAlgExecutionUnit | rewriteAggregateOnGroupByColumn (const RelAlgExecutionUnit &ra_exe_unit_in) const |
Private Member Functions | |
RelAlgExecutionUnit | rewriteConstrainedByIn (const RelAlgExecutionUnit &ra_exe_unit_in) const |
RelAlgExecutionUnit | rewriteConstrainedByInImpl (const RelAlgExecutionUnit &ra_exe_unit_in, const std::shared_ptr< Analyzer::CaseExpr >, const Analyzer::InValues *) const |
std::pair< bool, std::set < size_t > > | is_all_groupby_exprs_are_col_var (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby_exprs) const |
std::shared_ptr < Analyzer::CaseExpr > | generateCaseExprForCountDistinctOnGroupByCol (std::shared_ptr< Analyzer::Expr > expr) const |
Static Private Member Functions | |
static std::shared_ptr < Analyzer::CaseExpr > | generateCaseForDomainValues (const Analyzer::InValues *) |
Private Attributes | |
const std::vector < InputTableInfo > & | query_infos_ |
Executor * | executor_ |
std::vector< std::shared_ptr < Analyzer::Expr > > | target_exprs_owned_ |
Definition at line 28 of file QueryRewrite.h.
|
inline |
Definition at line 30 of file QueryRewrite.h.
|
private |
Definition at line 174 of file QueryRewrite.cpp.
References Datum::bigintval, is_null(), kBIGINT, kBOOLEAN, kISNULL, and kNOT.
Referenced by rewriteAggregateOnGroupByColumn().
|
staticprivate |
Definition at line 149 of file QueryRewrite.cpp.
References Analyzer::Expr::deep_copy(), Analyzer::InValues::get_arg(), Analyzer::InValues::get_value_list(), kBOOLEAN, kENCODING_DICT, kEQ, kONE, shared::StringDictKey::kTransientDictKey, and TRANSIENT_DICT_ID.
Referenced by rewriteConstrainedByIn().
|
private |
Definition at line 492 of file QueryRewrite.cpp.
References hash_value().
Referenced by rewriteAggregateOnGroupByColumn().
RelAlgExecutionUnit QueryRewriter::rewrite | ( | const RelAlgExecutionUnit & | ra_exe_unit_in | ) | const |
Definition at line 29 of file QueryRewrite.cpp.
References rewriteAggregateOnGroupByColumn(), and rewriteConstrainedByIn().
Referenced by rewriteConstrainedByInImpl().
RelAlgExecutionUnit QueryRewriter::rewriteAggregateOnGroupByColumn | ( | const RelAlgExecutionUnit & | ra_exe_unit_in | ) | const |
Definition at line 505 of file QueryRewrite.cpp.
References CHECK, CHECK_GT, RelAlgExecutionUnit::estimator, generateCaseExprForCountDistinctOnGroupByCol(), RelAlgExecutionUnit::groupby_exprs, RelAlgExecutionUnit::hash_table_build_plan_dag, hash_value(), RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, is_all_groupby_exprs_are_col_var(), RelAlgExecutionUnit::join_quals, kAPPROX_COUNT_DISTINCT, kAPPROX_QUANTILE, kAVG, kCOUNT, kCOUNT_IF, kFLOAT, kMAX, kMIN, kSAMPLE, RelAlgExecutionUnit::quals, RelAlgExecutionUnit::query_hint, RelAlgExecutionUnit::query_plan_dag_hash, RelAlgExecutionUnit::query_state, RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, RelAlgExecutionUnit::sort_info, RelAlgExecutionUnit::table_id_to_node_map, RelAlgExecutionUnit::target_exprs, RelAlgExecutionUnit::target_exprs_original_type_infos, target_exprs_owned_, RelAlgExecutionUnit::union_all, and RelAlgExecutionUnit::use_bump_allocator.
Referenced by rewrite().
RelAlgExecutionUnit QueryRewriter::rewriteColumnarDelete | ( | const RelAlgExecutionUnit & | ra_exe_unit_in, |
std::shared_ptr< Analyzer::ColumnVar > | delete_column | ||
) | const |
Definition at line 387 of file QueryRewrite.cpp.
References anonymous_namespace{Utm.h}::a, gpu_enabled::accumulate(), Datum::boolval, CHECK, CHECK_EQ, RelAlgExecutionUnit::estimator, RelAlgExecutionUnit::groupby_exprs, RelAlgExecutionUnit::hash_table_build_plan_dag, RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, RelAlgExecutionUnit::join_quals, kAND, kONE, Parser::CaseExpr::normalize(), RelAlgExecutionUnit::quals, RelAlgExecutionUnit::query_hint, RelAlgExecutionUnit::query_plan_dag_hash, RelAlgExecutionUnit::query_state, RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, RelAlgExecutionUnit::sort_info, RelAlgExecutionUnit::table_id_to_node_map, RelAlgExecutionUnit::target_exprs, RelAlgExecutionUnit::target_exprs_original_type_infos, target_exprs_owned_, RelAlgExecutionUnit::union_all, and RelAlgExecutionUnit::use_bump_allocator.
RelAlgExecutionUnit QueryRewriter::rewriteColumnarUpdate | ( | const RelAlgExecutionUnit & | ra_exe_unit_in, |
std::shared_ptr< Analyzer::ColumnVar > | column_to_update | ||
) | const |
Definition at line 216 of file QueryRewrite.cpp.
References anonymous_namespace{Utm.h}::a, gpu_enabled::accumulate(), CHECK, CHECK_EQ, anonymous_namespace{QueryRewrite.cpp}::check_string_id_overflow(), RelAlgExecutionUnit::estimator, executor_, Catalog_Namespace::SysCatalog::getCatalog(), RelAlgExecutionUnit::groupby_exprs, RelAlgExecutionUnit::hash_table_build_plan_dag, inline_fixed_encoding_null_val(), RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, Catalog_Namespace::SysCatalog::instance(), RelAlgExecutionUnit::join_quals, kAND, kCAST, kONE, Parser::CaseExpr::normalize(), RelAlgExecutionUnit::quals, RelAlgExecutionUnit::query_hint, RelAlgExecutionUnit::query_plan_dag_hash, RelAlgExecutionUnit::query_state, RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, RelAlgExecutionUnit::sort_info, Datum::stringval, RelAlgExecutionUnit::table_id_to_node_map, RelAlgExecutionUnit::target_exprs, RelAlgExecutionUnit::target_exprs_original_type_infos, target_exprs_owned_, to_string(), RelAlgExecutionUnit::union_all, and RelAlgExecutionUnit::use_bump_allocator.
|
private |
Definition at line 35 of file QueryRewrite.cpp.
References generateCaseForDomainValues(), RelAlgExecutionUnit::groupby_exprs, RelAlgExecutionUnit::quals, rewrite_expr(), rewriteConstrainedByInImpl(), and RelAlgExecutionUnit::simple_quals.
Referenced by rewrite().
|
private |
Definition at line 88 of file QueryRewrite.cpp.
References CHECK, executor_, g_constrained_by_in_threshold, Analyzer::InValues::get_arg(), getExpressionRange(), ExpressionRange::getIntMax(), RelAlgExecutionUnit::groupby_exprs, RelAlgExecutionUnit::hash_table_build_plan_dag, RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, Integer, RelAlgExecutionUnit::join_quals, Analyzer::Var::kGROUPBY, RelAlgExecutionUnit::quals, RelAlgExecutionUnit::query_hint, query_infos_, RelAlgExecutionUnit::query_plan_dag_hash, rewrite(), RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, RelAlgExecutionUnit::sort_info, RelAlgExecutionUnit::table_id_to_node_map, RelAlgExecutionUnit::target_exprs, RelAlgExecutionUnit::target_exprs_original_type_infos, and target_exprs_owned_.
Referenced by rewriteConstrainedByIn().
|
private |
Definition at line 64 of file QueryRewrite.h.
Referenced by rewriteColumnarUpdate(), and rewriteConstrainedByInImpl().
|
private |
Definition at line 63 of file QueryRewrite.h.
Referenced by rewriteConstrainedByInImpl().
|
mutableprivate |
Definition at line 65 of file QueryRewrite.h.
Referenced by rewriteAggregateOnGroupByColumn(), rewriteColumnarDelete(), rewriteColumnarUpdate(), and rewriteConstrainedByInImpl().