1#include "duckdb/common/field_writer.hpp"
2#include "duckdb/planner/operator/logical_delim_join.hpp"
3
4namespace duckdb {
5
6LogicalDelimJoin::LogicalDelimJoin(JoinType type)
7 : LogicalComparisonJoin(type, LogicalOperatorType::LOGICAL_DELIM_JOIN) {
8}
9
10void LogicalDelimJoin::Serialize(FieldWriter &writer) const {
11 LogicalComparisonJoin::Serialize(writer);
12 if (type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN) {
13 D_ASSERT(duplicate_eliminated_columns.empty());
14 // if the delim join has no delim columns anymore it is turned into a regular comparison join
15 return;
16 }
17 writer.WriteSerializableList(elements: duplicate_eliminated_columns);
18}
19
20unique_ptr<LogicalOperator> LogicalDelimJoin::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
21 auto result = make_uniq<LogicalDelimJoin>(args: JoinType::INVALID);
22 LogicalComparisonJoin::Deserialize(comparison_join&: *result, state, reader);
23 result->duplicate_eliminated_columns = reader.ReadRequiredSerializableList<Expression>(args&: state.gstate);
24 return std::move(result);
25}
26
27} // namespace duckdb
28