OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QueryPlanDagChecker.h
Go to the documentation of this file.
1 /*
2  * Copyright 2021 OmniSci, 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 #pragma once
18 
21 #include "RelRexDagVisitor.h"
22 
23 #include <unordered_set>
24 
25 class QueryPlanDagChecker final : public RelRexDagVisitor {
26  public:
27  QueryPlanDagChecker(const RelAlgTranslator& rel_alg_translator)
29  , rel_alg_translator_(rel_alg_translator)
31  static std::unordered_set<std::string> getNotSupportedFunctionsList() {
32  std::unordered_set<std::string> not_supported_functions;
33  not_supported_functions.emplace("CURRENT_USER");
34  not_supported_functions.emplace("CARDINALITY");
35  not_supported_functions.emplace("ARRAY_LENGTH");
36  not_supported_functions.emplace("ITEM");
37  not_supported_functions.emplace("NOW");
38  not_supported_functions.emplace("SIGN");
39  not_supported_functions.emplace("OFFSET_IN_FRAGMENT");
40  not_supported_functions.emplace("DATETIME");
41  return not_supported_functions;
42  }
43 
44  static bool isNotSupportedDag(const RelAlgNode* rel_alg_node,
45  const RelAlgTranslator& rel_alg_translator);
46  void check(const RelAlgNode*);
48  void reset();
49  bool getCheckResult() const;
50 
51  private:
52  void visit(const RelLogicalValues*) override;
53  void visit(const RelModify*) override;
54  void visit(const RelTableFunction*) override;
55  void visit(const RelProject*) override;
56  void visit(const RelScan*) override;
57  void visit(const RelCompound*) override;
58  void visit(const RelLogicalUnion*) override;
59 
60  void visit(const RexFunctionOperator*) override;
61  void visit(const RexOperator*) override;
62 
65  const std::unordered_set<std::string> not_supported_functions_;
66 };
void check(const RelAlgNode *)
static std::unordered_set< std::string > getNotSupportedFunctionsList()
const RelAlgTranslator & rel_alg_translator_
static bool isNotSupportedDag(const RelAlgNode *rel_alg_node, const RelAlgTranslator &rel_alg_translator)
void visit(const RelLogicalValues *) override
QueryPlanDagChecker(const RelAlgTranslator &rel_alg_translator)
const std::unordered_set< std::string > not_supported_functions_
bool g_enable_watchdog false
Definition: Execute.cpp:76