-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRelOpPlanNode.h
More file actions
114 lines (79 loc) · 2.09 KB
/
RelOpPlanNode.h
File metadata and controls
114 lines (79 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef QUERY_PLAN__NODE_H
#define QUERY_PLAN__NODE_H
#include "Schema.h"
#include "Function.h"
#include "Comparison.h"
#include "DBFile.h"
enum RelOpPlanNodeType {
SELECT_FILE,
SELECT_PIPE,
JOIN,
GROUP_BY,
SUM,
DUPLICATE_REMOVAL,
PROJECT,
};
class RelOpPlanNode {
public:
RelOpPlanNodeType type;
RelOpPlanNode *child1 = nullptr;
int inputPipeId1 = -1;
RelOpPlanNode *child2 = nullptr;
int inputPipeId2 = -1;
Schema *outputSchema = nullptr;
int outputPipeId = -1;
RelOpPlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
virtual void Print();
};
class DuplicateRemovalPlanNode : public RelOpPlanNode {
public:
Schema *inputSchema = nullptr;
DuplicateRemovalPlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
class GroupByPlanNode : public RelOpPlanNode {
public:
OrderMaker *groupAtts = nullptr;
Function *computeMe = nullptr;
int distinctFunc = 0;
GroupByPlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
class JoinPlanNode : public RelOpPlanNode {
public:
CNF *selOp = nullptr;
Record *literal = nullptr;
JoinPlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
class SelectFilePlanNode : public RelOpPlanNode {
public:
DBFile *dbFile = nullptr;
CNF *selOp = nullptr;
Record *literal = nullptr;
SelectFilePlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
class SelectPipePlanNode : public RelOpPlanNode {
public:
CNF *selOp = nullptr;
Record *literal = nullptr;
SelectPipePlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
class SumPlanNode : public RelOpPlanNode {
public:
Function *computeMe = nullptr;
int distinctFunc = 0;
SumPlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
class ProjectPlanNode : public RelOpPlanNode {
public:
int *keepMe = nullptr;
int numAttsInput;
int numAttsOutput;
ProjectPlanNode(RelOpPlanNode *child1, RelOpPlanNode *child2);
void Print();
};
#endif