1 | #include "duckdb/common/field_writer.hpp" |
---|---|
2 | #include "duckdb/planner/operator/logical_set.hpp" |
3 | |
4 | namespace duckdb { |
5 | |
6 | void LogicalSet::Serialize(FieldWriter &writer) const { |
7 | writer.WriteString(val: name); |
8 | value.Serialize(serializer&: writer.GetSerializer()); |
9 | writer.WriteField(element: scope); |
10 | } |
11 | |
12 | unique_ptr<LogicalOperator> LogicalSet::Deserialize(LogicalDeserializationState &state, FieldReader &reader) { |
13 | auto name = reader.ReadRequired<std::string>(); |
14 | auto value = Value::Deserialize(source&: reader.GetSource()); |
15 | auto scope = reader.ReadRequired<SetScope>(); |
16 | return make_uniq<LogicalSet>(args&: name, args&: value, args&: scope); |
17 | } |
18 | |
19 | idx_t LogicalSet::EstimateCardinality(ClientContext &context) { |
20 | return 1; |
21 | } |
22 | |
23 | } // namespace duckdb |
24 |