1#include "duckdb/common/field_writer.hpp"
2#include "duckdb/planner/operator/logical_empty_result.hpp"
3
4namespace duckdb {
5
6LogicalEmptyResult::LogicalEmptyResult(unique_ptr<LogicalOperator> op)
7 : LogicalOperator(LogicalOperatorType::LOGICAL_EMPTY_RESULT) {
8
9 this->bindings = op->GetColumnBindings();
10
11 op->ResolveOperatorTypes();
12 this->return_types = op->types;
13}
14
15LogicalEmptyResult::LogicalEmptyResult() : LogicalOperator(LogicalOperatorType::LOGICAL_EMPTY_RESULT) {
16}
17
18void LogicalEmptyResult::Serialize(FieldWriter &writer) const {
19 writer.WriteRegularSerializableList(elements: return_types);
20 writer.WriteList<ColumnBinding>(elements: bindings);
21}
22
23unique_ptr<LogicalOperator> LogicalEmptyResult::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
24 auto return_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
25 auto bindings = reader.ReadRequiredList<ColumnBinding>();
26 auto result = unique_ptr<LogicalEmptyResult>(new LogicalEmptyResult());
27 result->return_types = return_types;
28 result->bindings = bindings;
29 return std::move(result);
30}
31
32} // namespace duckdb
33