OmniSciDB  2e3a973ef4
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 
29 #include "../Shared/sqldefs.h"
32 
33 #include <list>
34 #include <memory>
35 #include <optional>
36 #include <vector>
37 
39 
40 namespace Analyzer {
41 class Expr;
42 class ColumnVar;
43 class Estimator;
44 struct OrderEntry;
45 
46 } // namespace Analyzer
47 
48 struct SortInfo {
49  const std::list<Analyzer::OrderEntry> order_entries;
51  const size_t limit;
52  const size_t offset;
53 };
54 
55 struct JoinCondition {
56  std::list<std::shared_ptr<Analyzer::Expr>> quals;
58 };
59 
60 using JoinQualsPerNestingLevel = std::vector<JoinCondition>;
61 
63  std::vector<InputDescriptor> input_descs;
64  std::list<std::shared_ptr<const InputColDescriptor>> input_col_descs;
65  std::list<std::shared_ptr<Analyzer::Expr>> simple_quals;
66  std::list<std::shared_ptr<Analyzer::Expr>> quals;
68  const std::list<std::shared_ptr<Analyzer::Expr>> groupby_exprs;
69  std::vector<Analyzer::Expr*> target_exprs;
70  const std::shared_ptr<Analyzer::Estimator> estimator;
72  size_t scan_limit;
73  bool use_bump_allocator{false};
74  // empty if not a UNION, true if UNION ALL, false if regular UNION
75  const std::optional<bool> union_all;
76  std::shared_ptr<const query_state::QueryState> query_state;
77 };
78 
79 std::ostream& operator<<(std::ostream& os, const RelAlgExecutionUnit& ra_exe_unit);
80 std::string ra_exec_unit_desc_for_caching(const RelAlgExecutionUnit& ra_exe_unit);
81 
83  const std::vector<InputDescriptor> input_descs;
84  std::list<std::shared_ptr<const InputColDescriptor>> input_col_descs;
85  std::vector<Analyzer::Expr*> input_exprs;
86  std::vector<Analyzer::ColumnVar*> table_func_inputs;
87  std::vector<Analyzer::Expr*> target_exprs;
88  const std::optional<size_t> output_buffer_multiplier;
89  const std::string table_func_name;
90 
91  public:
92  std::string toString() const {
93  return typeName(this) + "(" + "input_exprs=" + ::toString(input_exprs) +
94  ", table_func_inputs=" + ::toString(table_func_inputs) +
95  ", target_exprs=" + ::toString(target_exprs) +
96  ", output_buffer_multiplier=" + ::toString(output_buffer_multiplier) +
97  ", table_func_name=" + ::toString(table_func_name) + ")";
98  }
99 };
100 
101 class ResultSet;
102 using ResultSetPtr = std::shared_ptr<ResultSet>;
103 
104 #endif // QUERYENGINE_RELALGEXECUTIONUNIT_H
std::vector< Analyzer::Expr * > target_exprs
const std::string table_func_name
JoinType
Definition: sqldefs.h:107
std::string toString(const ExtArgumentType &sig_type)
std::vector< Analyzer::Expr * > input_exprs
std::ostream & operator<<(std::ostream &os, const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1242
std::vector< Analyzer::ColumnVar * > table_func_inputs
const std::optional< size_t > output_buffer_multiplier
std::string ra_exec_unit_desc_for_caching(const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1191
const std::optional< bool > union_all
const std::list< Analyzer::OrderEntry > order_entries
const std::vector< InputDescriptor > input_descs
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
std::string typeName(const T *v)
std::string toString() const
const size_t limit
const SortInfo sort_info
const JoinQualsPerNestingLevel join_quals
SortAlgorithm
const std::shared_ptr< Analyzer::Estimator > estimator
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
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