OmniSciDB
a5dc49c757
|
#include <PlanState.h>
Public Types | |
using | DeletedColumnsMap = std::unordered_map< shared::TableKey, const ColumnDescriptor * > |
using | HoistedFiltersSet = std::unordered_set< std::shared_ptr< Analyzer::Expr >> |
Public Member Functions | |
PlanState (const bool allow_lazy_fetch, const std::vector< InputTableInfo > &query_infos, const DeletedColumnsMap &deleted_columns, const Executor *executor) | |
deleted_columns_ (deleted_columns) | |
query_infos_ (query_infos) | |
executor_ (executor) | |
void | allocateLocalColumnIds (const std::list< std::shared_ptr< const InputColDescriptor >> &global_col_ids) |
int | getLocalColumnId (const Analyzer::ColumnVar *col_var, const bool fetch_column) |
bool | isLazyFetchColumn (const Analyzer::Expr *target_expr) const |
bool | isLazyFetchColumn (const InputColDescriptor &col_desc) |
const ColumnDescriptor * | getDeletedColForTable (const shared::TableKey &table_key) |
void | addSimpleQual (std::shared_ptr< Analyzer::Expr > simple_qual) |
std::list< std::shared_ptr < Analyzer::Expr > > | getSimpleQuals () const |
void | addNonHashtableQualForLeftJoin (size_t idx, std::shared_ptr< Analyzer::Expr > expr) |
const std::unordered_set < shared::ColumnKey > & | getColumnsToFetch () const |
const std::unordered_set < shared::ColumnKey > & | getColumnsToNotFetch () const |
bool | isColumnToFetch (const shared::ColumnKey &column_key) const |
bool | isColumnToNotFetch (const shared::ColumnKey &column_key) const |
void | addColumnToFetch (const shared::ColumnKey &column_key, bool unmark_lazy_fetch=false) |
void | addColumnToNotFetch (const shared::ColumnKey &column_key) |
bool | hasExpressionNeedsLazyFetch (const std::vector< TargetExprCodegen > &target_exprs_to_codegen) const |
void | registerNonLazyFetchExpression (const std::vector< TargetExprCodegen > &target_exprs_to_codegen) |
Public Attributes | |
std::vector< int64_t > | init_agg_vals_ |
HoistedFiltersSet | hoisted_filters_ |
std::unordered_map < InputColDescriptor, size_t > | global_to_local_col_ids_ |
std::unordered_map< size_t, std::vector< std::shared_ptr < Analyzer::Expr > > > | left_join_non_hashtable_quals_ |
bool | allow_lazy_fetch_ |
JoinInfo | join_info_ |
const DeletedColumnsMap | deleted_columns_ |
const std::vector < InputTableInfo > & | query_infos_ |
std::list< std::shared_ptr < Analyzer::Expr > > | simple_quals_ |
const Executor * | executor_ |
Private Attributes | |
std::unordered_set < shared::ColumnKey > | columns_to_fetch_ |
std::unordered_set < shared::ColumnKey > | columns_to_not_fetch_ |
Definition at line 43 of file PlanState.h.
using PlanState::DeletedColumnsMap = std::unordered_map<shared::TableKey, const ColumnDescriptor*> |
Definition at line 44 of file PlanState.h.
using PlanState::HoistedFiltersSet = std::unordered_set<std::shared_ptr<Analyzer::Expr>> |
Definition at line 45 of file PlanState.h.
|
inline |
Definition at line 47 of file PlanState.h.
void PlanState::addColumnToFetch | ( | const shared::ColumnKey & | column_key, |
bool | unmark_lazy_fetch = false |
||
) |
Definition at line 124 of file PlanState.cpp.
References CHECK, columns_to_fetch_, columns_to_not_fetch_, and isColumnToNotFetch().
Referenced by CodeGenerator::codegenColVar(), getLocalColumnId(), anonymous_namespace{GeoIR.cpp}::mark_logical_column_to_fetch(), and registerNonLazyFetchExpression().
void PlanState::addColumnToNotFetch | ( | const shared::ColumnKey & | column_key | ) |
Definition at line 147 of file PlanState.cpp.
References CHECK, columns_to_not_fetch_, and isColumnToFetch().
Referenced by CodeGenerator::codegenColVar().
void PlanState::addNonHashtableQualForLeftJoin | ( | size_t | idx, |
std::shared_ptr< Analyzer::Expr > | expr | ||
) |
Definition at line 95 of file PlanState.cpp.
References left_join_non_hashtable_quals_.
|
inline |
Definition at line 93 of file PlanState.h.
References simple_quals_.
void PlanState::allocateLocalColumnIds | ( | const std::list< std::shared_ptr< const InputColDescriptor >> & | global_col_ids | ) |
Definition at line 40 of file PlanState.cpp.
References CHECK, and global_to_local_col_ids_.
Referenced by ScalarCodeGenerator::prepare().
PlanState::deleted_columns_ | ( | deleted_columns | ) |
|
inline |
Definition at line 55 of file PlanState.h.
const std::unordered_set< shared::ColumnKey > & PlanState::getColumnsToFetch | ( | ) | const |
Definition at line 106 of file PlanState.cpp.
References columns_to_fetch_.
const std::unordered_set< shared::ColumnKey > & PlanState::getColumnsToNotFetch | ( | ) | const |
Definition at line 110 of file PlanState.cpp.
References columns_to_not_fetch_.
|
inline |
int PlanState::getLocalColumnId | ( | const Analyzer::ColumnVar * | col_var, |
const bool | fetch_column | ||
) |
Definition at line 52 of file PlanState.cpp.
References addColumnToFetch(), CHECK, Analyzer::ColumnVar::get_rte_idx(), Analyzer::ColumnVar::getColumnKey(), and global_to_local_col_ids_.
Referenced by ScalarCodeGenerator::codegenColumn(), and CodeGenerator::colByteStream().
|
inline |
Definition at line 97 of file PlanState.h.
References simple_quals_.
Referenced by CodeGenerator::codegen().
bool PlanState::hasExpressionNeedsLazyFetch | ( | const std::vector< TargetExprCodegen > & | target_exprs_to_codegen | ) | const |
Definition at line 152 of file PlanState.cpp.
References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of().
Referenced by registerNonLazyFetchExpression().
bool PlanState::isColumnToFetch | ( | const shared::ColumnKey & | column_key | ) | const |
Definition at line 114 of file PlanState.cpp.
References columns_to_fetch_, and shared::contains().
Referenced by addColumnToNotFetch(), and CodeGenerator::codegenColVar().
bool PlanState::isColumnToNotFetch | ( | const shared::ColumnKey & | column_key | ) | const |
Definition at line 118 of file PlanState.cpp.
References columns_to_not_fetch_, and shared::contains().
Referenced by addColumnToFetch().
bool PlanState::isLazyFetchColumn | ( | const Analyzer::Expr * | target_expr | ) | const |
Definition at line 22 of file PlanState.cpp.
References allow_lazy_fetch_, columns_to_fetch_, get_column_descriptor(), and Analyzer::ColumnVar::getColumnKey().
Referenced by CodeGenerator::codegenColVar(), and isLazyFetchColumn().
|
inline |
Definition at line 77 of file PlanState.h.
References InputColDescriptor::getColId(), InputDescriptor::getNestLevel(), InputColDescriptor::getScanDesc(), InputDescriptor::getTableKey(), and isLazyFetchColumn().
PlanState::query_infos_ | ( | query_infos | ) |
void PlanState::registerNonLazyFetchExpression | ( | const std::vector< TargetExprCodegen > & | target_exprs_to_codegen | ) |
Definition at line 161 of file PlanState.cpp.
References addColumnToFetch(), and hasExpressionNeedsLazyFetch().
bool PlanState::allow_lazy_fetch_ |
Definition at line 62 of file PlanState.h.
Referenced by isLazyFetchColumn().
|
private |
Definition at line 116 of file PlanState.h.
Referenced by addColumnToFetch(), getColumnsToFetch(), isColumnToFetch(), and isLazyFetchColumn().
|
mutableprivate |
Definition at line 117 of file PlanState.h.
Referenced by addColumnToFetch(), addColumnToNotFetch(), getColumnsToNotFetch(), and isColumnToNotFetch().
const DeletedColumnsMap PlanState::deleted_columns_ |
Definition at line 64 of file PlanState.h.
Referenced by getDeletedColForTable().
const Executor* PlanState::executor_ |
Definition at line 68 of file PlanState.h.
Referenced by anonymous_namespace{ExternalExecutor.cpp}::create_table_schema().
std::unordered_map<InputColDescriptor, size_t> PlanState::global_to_local_col_ids_ |
Definition at line 59 of file PlanState.h.
Referenced by allocateLocalColumnIds(), anonymous_namespace{ExternalExecutor.cpp}::create_table_schema(), and getLocalColumnId().
HoistedFiltersSet PlanState::hoisted_filters_ |
Definition at line 58 of file PlanState.h.
std::vector<int64_t> PlanState::init_agg_vals_ |
Definition at line 57 of file PlanState.h.
JoinInfo PlanState::join_info_ |
Definition at line 63 of file PlanState.h.
Referenced by CodeGenerator::hashJoinLhs(), and CodeGenerator::needCastForHashJoinLhs().
std::unordered_map<size_t, std::vector<std::shared_ptr<Analyzer::Expr> > > PlanState::left_join_non_hashtable_quals_ |
Definition at line 61 of file PlanState.h.
Referenced by addNonHashtableQualForLeftJoin(), and Executor::buildJoinLoops().
const std::vector<InputTableInfo>& PlanState::query_infos_ |
Definition at line 65 of file PlanState.h.
Referenced by CodeGenerator::checkExpressionRanges(), and CodeGenerator::codegen().
std::list<std::shared_ptr<Analyzer::Expr> > PlanState::simple_quals_ |
Definition at line 66 of file PlanState.h.
Referenced by addSimpleQual(), and getSimpleQuals().