OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "../QueryEngine/Execute.h"
20 
22  public:
23  QueryRewriter(const std::vector<InputTableInfo>& query_infos, Executor* executor)
24  : query_infos_(query_infos), executor_(executor) {}
25  RelAlgExecutionUnit rewrite(const RelAlgExecutionUnit& ra_exe_unit_in) const;
26 
28  const RelAlgExecutionUnit& ra_exe_unit_in,
29  std::shared_ptr<Analyzer::Expr> column_to_update) const;
30 
32  const RelAlgExecutionUnit& ra_exe_unit_in,
33  std::shared_ptr<Analyzer::ColumnVar> delete_column) const;
34 
35  private:
37  const RelAlgExecutionUnit& ra_exe_unit_in) const;
38 
40  const RelAlgExecutionUnit& ra_exe_unit_in) const;
41 
43  const RelAlgExecutionUnit& ra_exe_unit_in,
44  const std::shared_ptr<Analyzer::CaseExpr>,
45  const Analyzer::InValues*) const;
46 
47  static std::shared_ptr<Analyzer::CaseExpr> generateCaseForDomainValues(
48  const Analyzer::InValues*);
49 
50  const std::vector<InputTableInfo>& query_infos_;
51  Executor* executor_;
52  mutable std::vector<std::shared_ptr<Analyzer::Expr>> target_exprs_owned_;
53 };
RelAlgExecutionUnit rewrite(const RelAlgExecutionUnit &ra_exe_unit_in) const
Executor * executor_
Definition: QueryRewrite.h:51
RelAlgExecutionUnit rewriteOverlapsJoin(const RelAlgExecutionUnit &ra_exe_unit_in) const
RelAlgExecutionUnit rewriteColumnarUpdate(const RelAlgExecutionUnit &ra_exe_unit_in, std::shared_ptr< Analyzer::Expr > column_to_update) const
const std::vector< InputTableInfo > & query_infos_
Definition: QueryRewrite.h:50
RelAlgExecutionUnit rewriteColumnarDelete(const RelAlgExecutionUnit &ra_exe_unit_in, std::shared_ptr< Analyzer::ColumnVar > delete_column) const
QueryRewriter(const std::vector< InputTableInfo > &query_infos, Executor *executor)
Definition: QueryRewrite.h:23
static std::shared_ptr< Analyzer::CaseExpr > generateCaseForDomainValues(const Analyzer::InValues *)
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::vector< std::shared_ptr< Analyzer::Expr > > target_exprs_owned_
Definition: QueryRewrite.h:52