OmniSciDB  04ee39c94c
QueryRewrite.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 
17 #include "../Analyzer/Analyzer.h"
18 #include "../Fragmenter/Fragmenter.h"
19 #include "../Planner/Planner.h"
20 #include "../QueryEngine/Execute.h"
21 
23  public:
24  QueryRewriter(const std::vector<InputTableInfo>& query_infos, const Executor* executor)
25  : query_infos_(query_infos), executor_(executor) {}
26  RelAlgExecutionUnit rewrite(const RelAlgExecutionUnit& ra_exe_unit_in) const;
27 
28  private:
30  const RelAlgExecutionUnit& ra_exe_unit_in) const;
31 
33  const RelAlgExecutionUnit& ra_exe_unit_in) const;
34 
36  const RelAlgExecutionUnit& ra_exe_unit_in,
37  const std::shared_ptr<Analyzer::CaseExpr>,
38  const Analyzer::InValues*) const;
39 
40  static std::shared_ptr<Analyzer::CaseExpr> generateCaseForDomainValues(
41  const Analyzer::InValues*);
42 
43  const std::vector<InputTableInfo>& query_infos_;
44  const Executor* executor_;
45  mutable std::vector<std::shared_ptr<Analyzer::Expr>> target_exprs_owned_;
46 };
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
RelAlgExecutionUnit rewrite(const RelAlgExecutionUnit &ra_exe_unit_in) const
RelAlgExecutionUnit rewriteOverlapsJoin(const RelAlgExecutionUnit &ra_exe_unit_in) const
QueryRewriter(const std::vector< InputTableInfo > &query_infos, const Executor *executor)
Definition: QueryRewrite.h:24
const std::vector< InputTableInfo > & query_infos_
Definition: QueryRewrite.h:43
const Executor * executor_
Definition: QueryRewrite.h:44
static std::shared_ptr< Analyzer::CaseExpr > generateCaseForDomainValues(const Analyzer::InValues *)
std::vector< std::shared_ptr< Analyzer::Expr > > target_exprs_owned_
Definition: QueryRewrite.h:45