| 1 | #include "duckdb/planner/operator/logical_set_operation.hpp" |
|---|---|
| 2 | |
| 3 | #include "duckdb/common/field_writer.hpp" |
| 4 | #include "duckdb/main/config.hpp" |
| 5 | |
| 6 | namespace duckdb { |
| 7 | |
| 8 | void LogicalSetOperation::Serialize(FieldWriter &writer) const { |
| 9 | writer.WriteField(element: table_index); |
| 10 | writer.WriteField(element: column_count); |
| 11 | } |
| 12 | |
| 13 | unique_ptr<LogicalOperator> LogicalSetOperation::Deserialize(LogicalDeserializationState &state, FieldReader &reader) { |
| 14 | auto table_index = reader.ReadRequired<idx_t>(); |
| 15 | auto column_count = reader.ReadRequired<idx_t>(); |
| 16 | // TODO(stephwang): review if unique_ptr<LogicalOperator> plan is needed |
| 17 | return unique_ptr<LogicalSetOperation>(new LogicalSetOperation(table_index, column_count, state.type)); |
| 18 | } |
| 19 | |
| 20 | vector<idx_t> LogicalSetOperation::GetTableIndex() const { |
| 21 | return vector<idx_t> {table_index}; |
| 22 | } |
| 23 | |
| 24 | string LogicalSetOperation::GetName() const { |
| 25 | #ifdef DEBUG |
| 26 | if (DBConfigOptions::debug_print_bindings) { |
| 27 | return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index); |
| 28 | } |
| 29 | #endif |
| 30 | return LogicalOperator::GetName(); |
| 31 | } |
| 32 | |
| 33 | } // namespace duckdb |
| 34 |