OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExpressionRewrite.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 #ifndef QUERYENGINE_EXPRESSIONREWRITE_H
18 #define QUERYENGINE_EXPRESSIONREWRITE_H
19 
20 #include <boost/optional.hpp>
21 #include <list>
22 #include <memory>
23 #include <vector>
24 
25 #include "Analyzer/Analyzer.h"
26 #include "RelAlgExecutionUnit.h"
27 
28 namespace Analyzer {
29 
30 class Expr;
31 
32 class InValues;
33 
34 } // namespace Analyzer
35 
36 class InputColDescriptor;
37 
38 // Rewrites an OR tree where leaves are equality compare against literals.
40 
41 // Rewrites array elements that are strings to be dict encoded transient literals
43 
44 // Rewrite a FunctionOper to an AND between a BinOper and the FunctionOper if the
45 // FunctionOper is supported for overlaps joins
47  std::list<std::shared_ptr<Analyzer::Expr>> quals;
48  std::list<std::shared_ptr<Analyzer::Expr>> join_quals;
49 };
50 
51 boost::optional<OverlapsJoinConjunction> rewrite_overlaps_conjunction(
52  const std::shared_ptr<Analyzer::Expr> expr);
53 
54 std::list<std::shared_ptr<Analyzer::Expr>> strip_join_covered_filter_quals(
55  const std::list<std::shared_ptr<Analyzer::Expr>>& quals,
56  const JoinQualsPerNestingLevel& join_quals);
57 
58 std::shared_ptr<Analyzer::Expr> fold_expr(const Analyzer::Expr*);
59 
60 #endif // QUERYENGINE_EXPRESSIONREWRITE_H
Defines data structures for the semantic analysis phase of query processing.
Analyzer::ExpressionPtr rewrite_array_elements(Analyzer::Expr const *expr)
std::list< std::shared_ptr< Analyzer::Expr > > quals
std::shared_ptr< Analyzer::Expr > ExpressionPtr
Definition: Analyzer.h:180
std::list< std::shared_ptr< Analyzer::Expr > > join_quals
std::vector< JoinCondition > JoinQualsPerNestingLevel
Analyzer::ExpressionPtr rewrite_expr(const Analyzer::Expr *expr)
std::list< std::shared_ptr< Analyzer::Expr > > strip_join_covered_filter_quals(const std::list< std::shared_ptr< Analyzer::Expr >> &quals, const JoinQualsPerNestingLevel &join_quals)
boost::optional< OverlapsJoinConjunction > rewrite_overlaps_conjunction(const std::shared_ptr< Analyzer::Expr > expr)
Execution unit for relational algebra. It&#39;s a low-level description of any relational algebra operati...
std::shared_ptr< Analyzer::Expr > fold_expr(const Analyzer::Expr *expr)