1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/operator/logical_sample.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/planner/logical_operator.hpp"
12#include "duckdb/parser/parsed_data/sample_options.hpp"
13
14namespace duckdb {
15
16//! LogicalSample represents a SAMPLE clause
17class LogicalSample : public LogicalOperator {
18public:
19 static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_SAMPLE;
20
21public:
22 LogicalSample(unique_ptr<SampleOptions> sample_options_p, unique_ptr<LogicalOperator> child);
23
24 //! The sample options
25 unique_ptr<SampleOptions> sample_options;
26
27public:
28 vector<ColumnBinding> GetColumnBindings() override;
29 idx_t EstimateCardinality(ClientContext &context) override;
30
31 void Serialize(FieldWriter &writer) const override;
32 static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
33
34protected:
35 void ResolveTypes() override;
36};
37
38} // namespace duckdb
39