OmniSciDB  a987f07e93
 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 2022 HEAVY.AI, 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 
19 #include "QueryEngine/RelAlgDag.h"
21 #include "RelRexDagVisitor.h"
22 
23 #include <unordered_set>
24 
25 class QueryPlanDagChecker final : public RelRexDagVisitor {
26  public:
31  static std::unordered_set<std::string> getNonSupportedFunctionsList() {
32  std::unordered_set<std::string> non_supported_functions;
33  non_supported_functions.emplace("CURRENT_USER");
34  non_supported_functions.emplace("CURRENT_TIME");
35  non_supported_functions.emplace("CURRENT_DATE");
36  non_supported_functions.emplace("CURRENT_TIMESTAMP");
37  non_supported_functions.emplace("CARDINALITY");
38  non_supported_functions.emplace("ARRAY_LENGTH");
39  non_supported_functions.emplace("ITEM");
40  non_supported_functions.emplace("NOW");
41  non_supported_functions.emplace("SIGN");
42  non_supported_functions.emplace("OFFSET_IN_FRAGMENT");
43  non_supported_functions.emplace("DATETIME");
44  return non_supported_functions;
45  }
46 
47  static std::pair<bool, std::string> hasNonSupportedNodeInDag(
48  const RelAlgNode* rel_alg_node);
49  void check(const RelAlgNode*);
50  void detectNonSupportedNode(const std::string& node_tag);
51  void reset();
52  bool getCheckResult() const;
53  std::string const& getNonSupportedNodeTag() const;
54 
55  private:
56  void visit(const RelLogicalValues*) override;
57  void visit(const RelModify*) override;
58  void visit(const RelProject*) override;
59  void visit(const RelScan*) override;
60  void visit(const RelCompound*) override;
61  void visit(const RelLogicalUnion*) override;
62 
63  void visit(const RexFunctionOperator*) override;
64  void visit(const RexOperator*) override;
65 
68  const std::unordered_set<std::string> non_supported_functions_;
69 };
std::string non_supported_node_tag_
void check(const RelAlgNode *)
static std::pair< bool, std::string > hasNonSupportedNodeInDag(const RelAlgNode *rel_alg_node)
std::string const & getNonSupportedNodeTag() const
void visit(const RelLogicalValues *) override
const std::unordered_set< std::string > non_supported_functions_
void detectNonSupportedNode(const std::string &node_tag)
bool g_enable_watchdog false
Definition: Execute.cpp:79
static std::unordered_set< std::string > getNonSupportedFunctionsList()