YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/pt_explain.h
Line
Count
Source
1
//--------------------------------------------------------------------------------------------------
2
// Copyright (c) YugaByte, Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
// in compliance with the License.  You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software distributed under the License
10
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
// or implied.  See the License for the specific language governing permissions and limitations
12
// under the License.
13
//
14
//
15
// Tree node definitions for EXPLAIN statement.
16
//--------------------------------------------------------------------------------------------------
17
18
#ifndef YB_YQL_CQL_QL_PTREE_PT_EXPLAIN_H_
19
#define YB_YQL_CQL_QL_PTREE_PT_EXPLAIN_H_
20
21
#include "yb/yql/cql/ql/ptree/list_node.h"
22
#include "yb/yql/cql/ql/ptree/tree_node.h"
23
24
namespace yb {
25
namespace ql {
26
27
//--------------------------------------------------------------------------------------------------
28
29
class PTExplainStmt : public TreeNode {
30
 public:
31
  //------------------------------------------------------------------------------------------------
32
  // Public types.
33
  typedef MCSharedPtr<PTExplainStmt> SharedPtr;
34
  typedef MCSharedPtr<const PTExplainStmt> SharedPtrConst;
35
36
  //------------------------------------------------------------------------------------------------
37
  // Constructor and destructor.
38
  PTExplainStmt(MemoryContext *memctx,
39
                YBLocationPtr loc,
40
                TreeNode::SharedPtr stmt);
41
  virtual ~PTExplainStmt();
42
43
  template<typename... TypeArgs>
44
  inline static PTExplainStmt::SharedPtr MakeShared(MemoryContext *memctx,
45
167
                                                    TypeArgs&&... args) {
46
167
    return MCMakeShared<PTExplainStmt>(memctx, std::forward<TypeArgs>(args)...);
47
167
  }
48
49
//  // Node semantics analysis.
50
  virtual CHECKED_STATUS Analyze(SemContext *sem_context) override;
51
  void PrintSemanticAnalysisResult(SemContext *sem_context);
52
53
  // Node type.
54
1.10k
  virtual TreeNodeOpcode opcode() const override {
55
1.10k
    return TreeNodeOpcode::kPTExplainStmt;
56
1.10k
  }
57
58
314
  TreeNode::SharedPtr stmt() const {
59
314
    return stmt_;
60
314
  }
61
 private:
62
  // --- The parser will decorate this node with the following information --
63
64
  TreeNode::SharedPtr stmt_;
65
66
  // -- The semantic analyzer will decorate this node with the following information --
67
68
};
69
70
}  // namespace ql
71
}  // namespace yb
72
73
#endif  // YB_YQL_CQL_QL_PTREE_PT_EXPLAIN_H_