OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RelAlgExecutionUnit.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
26 #ifndef QUERYENGINE_RELALGEXECUTIONUNIT_H
27 #define QUERYENGINE_RELALGEXECUTIONUNIT_H
28 
30 #include "QueryHint.h"
31 #include "Shared/sqldefs.h"
32 #include "Shared/toString.h"
36 
37 #include <list>
38 #include <memory>
39 #include <optional>
40 #include <vector>
41 
43 
44 namespace Analyzer {
45 class Expr;
46 class ColumnVar;
47 class Estimator;
48 struct OrderEntry;
49 
50 } // namespace Analyzer
51 
52 struct SortInfo {
53  const std::list<Analyzer::OrderEntry> order_entries;
55  const size_t limit;
56  const size_t offset;
57 };
58 
59 struct JoinCondition {
60  std::list<std::shared_ptr<Analyzer::Expr>> quals;
62 };
63 
64 using JoinQualsPerNestingLevel = std::vector<JoinCondition>;
65 
67  std::vector<InputDescriptor> input_descs;
68  std::list<std::shared_ptr<const InputColDescriptor>> input_col_descs;
69  std::list<std::shared_ptr<Analyzer::Expr>> simple_quals;
70  std::list<std::shared_ptr<Analyzer::Expr>> quals;
72  const std::list<std::shared_ptr<Analyzer::Expr>> groupby_exprs;
73  std::vector<Analyzer::Expr*> target_exprs;
74  const std::shared_ptr<Analyzer::Estimator> estimator;
76  size_t scan_limit;
78  bool use_bump_allocator{false};
79  // empty if not a UNION, true if UNION ALL, false if regular UNION
80  const std::optional<bool> union_all;
81  std::shared_ptr<const query_state::QueryState> query_state;
82 };
83 
84 std::ostream& operator<<(std::ostream& os, const RelAlgExecutionUnit& ra_exe_unit);
85 std::string ra_exec_unit_desc_for_caching(const RelAlgExecutionUnit& ra_exe_unit);
86 
88  const std::vector<InputDescriptor> input_descs;
89  std::list<std::shared_ptr<const InputColDescriptor>> input_col_descs;
90  std::vector<Analyzer::Expr*> input_exprs;
91  std::vector<Analyzer::ColumnVar*> table_func_inputs;
92  std::vector<Analyzer::Expr*> target_exprs;
95 
96  public:
97  std::string toString() const {
98  return typeName(this) + "(" + "input_exprs=" + ::toString(input_exprs) +
99  ", table_func_inputs=" + ::toString(table_func_inputs) +
100  ", target_exprs=" + ::toString(target_exprs) +
101  ", output_buffer_size_param=" + ::toString(output_buffer_size_param) +
102  ", table_func=" + ::toString(table_func) + ")";
103  }
104 };
105 
106 class ResultSet;
107 using ResultSetPtr = std::shared_ptr<ResultSet>;
108 
109 #endif // QUERYENGINE_RELALGEXECUTIONUNIT_H
std::vector< Analyzer::Expr * > target_exprs
JoinType
Definition: sqldefs.h:108
std::string ra_exec_unit_desc_for_caching(const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1227
std::vector< Analyzer::Expr * > input_exprs
std::vector< Analyzer::ColumnVar * > table_func_inputs
const std::optional< bool > union_all
const table_functions::TableFunction table_func
std::ostream & operator<<(std::ostream &os, const SessionInfo &session_info)
Definition: SessionInfo.cpp:53
const std::list< Analyzer::OrderEntry > order_entries
const std::vector< InputDescriptor > input_descs
ResultSet(const std::vector< TargetInfo > &targets, const ExecutorDeviceType device_type, const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const Catalog_Namespace::Catalog *catalog, const unsigned block_size, const unsigned grid_size)
Definition: ResultSet.cpp:60
std::vector< InputDescriptor > input_descs
const SortAlgorithm algorithm
std::vector< JoinCondition > JoinQualsPerNestingLevel
std::shared_ptr< ResultSet > ResultSetPtr
const std::list< std::shared_ptr< Analyzer::Expr > > groupby_exprs
const size_t limit
const SortInfo sort_info
const JoinQualsPerNestingLevel join_quals
SortAlgorithm
const std::shared_ptr< Analyzer::Estimator > estimator
std::string toString() const
std::string typeName(const T *v)
Definition: toString.h:81
std::list< std::shared_ptr< Analyzer::Expr > > quals
std::list< std::shared_ptr< Analyzer::Expr > > quals
std::list< std::shared_ptr< const InputColDescriptor > > input_col_descs
std::shared_ptr< const query_state::QueryState > query_state
Common Enum definitions for SQL processing.
std::vector< Analyzer::Expr * > target_exprs
std::list< std::shared_ptr< const InputColDescriptor > > input_col_descs
const size_t offset
std::list< std::shared_ptr< Analyzer::Expr > > simple_quals