1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/planner/operator/logical_set_operation.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/planner/logical_operator.hpp" |
12 | |
13 | namespace duckdb { |
14 | |
15 | class LogicalSetOperation : public LogicalOperator { |
16 | public: |
17 | LogicalSetOperation(idx_t table_index, idx_t column_count, unique_ptr<LogicalOperator> top, |
18 | unique_ptr<LogicalOperator> bottom, LogicalOperatorType type) |
19 | : LogicalOperator(type), table_index(table_index), column_count(column_count) { |
20 | assert(type == LogicalOperatorType::UNION || type == LogicalOperatorType::EXCEPT || |
21 | type == LogicalOperatorType::INTERSECT); |
22 | children.push_back(move(top)); |
23 | children.push_back(move(bottom)); |
24 | } |
25 | |
26 | idx_t table_index; |
27 | idx_t column_count; |
28 | |
29 | public: |
30 | vector<ColumnBinding> GetColumnBindings() override { |
31 | return GenerateColumnBindings(table_index, column_count); |
32 | } |
33 | |
34 | protected: |
35 | void ResolveTypes() override { |
36 | types = children[0]->types; |
37 | } |
38 | }; |
39 | } // namespace duckdb |
40 |