1#include "duckdb/parser/query_node/set_operation_node.hpp"
2
3using namespace duckdb;
4using namespace std;
5
6bool SetOperationNode::Equals(const QueryNode *other_) const {
7 if (!QueryNode::Equals(other_)) {
8 return false;
9 }
10 if (this == other_) {
11 return true;
12 }
13 auto other = (SetOperationNode *)other_;
14 if (setop_type != other->setop_type) {
15 return false;
16 }
17 if (!left->Equals(other->left.get())) {
18 return false;
19 }
20 if (!right->Equals(other->right.get())) {
21 return false;
22 }
23 return true;
24}
25
26unique_ptr<QueryNode> SetOperationNode::Copy() {
27 auto result = make_unique<SetOperationNode>();
28 result->setop_type = setop_type;
29 result->left = left->Copy();
30 result->right = right->Copy();
31 this->CopyProperties(*result);
32 return move(result);
33}
34
35void SetOperationNode::Serialize(Serializer &serializer) {
36 QueryNode::Serialize(serializer);
37 serializer.Write<SetOperationType>(setop_type);
38 left->Serialize(serializer);
39 right->Serialize(serializer);
40}
41
42unique_ptr<QueryNode> SetOperationNode::Deserialize(Deserializer &source) {
43 auto result = make_unique<SetOperationNode>();
44 result->setop_type = source.Read<SetOperationType>();
45 result->left = QueryNode::Deserialize(source);
46 result->right = QueryNode::Deserialize(source);
47 return move(result);
48}
49