1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/operator/logical_pivot.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/common/unordered_map.hpp"
12#include "duckdb/common/unordered_set.hpp"
13#include "duckdb/planner/logical_operator.hpp"
14#include "duckdb/parser/tableref/pivotref.hpp"
15#include "duckdb/planner/tableref/bound_pivotref.hpp"
16
17namespace duckdb {
18
19class LogicalPivot : public LogicalOperator {
20public:
21 static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_PIVOT;
22
23public:
24 LogicalPivot(idx_t pivot_idx, unique_ptr<LogicalOperator> plan, BoundPivotInfo info);
25
26 idx_t pivot_index;
27 //! The bound pivot info
28 BoundPivotInfo bound_pivot;
29
30public:
31 vector<ColumnBinding> GetColumnBindings() override;
32 void Serialize(FieldWriter &writer) const override;
33 static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
34 vector<idx_t> GetTableIndex() const override;
35 string GetName() const override;
36
37protected:
38 void ResolveTypes() override;
39};
40} // namespace duckdb
41