//===----------------------------------------------------------------------===// // DuckDB // // duckdb/planner/operator/logical_get.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/function/table_function.hpp" #include "duckdb/planner/logical_operator.hpp" #include "duckdb/planner/table_filter.hpp" namespace duckdb { //! LogicalGet represents a scan operation from a data source class LogicalGet : public LogicalOperator { public: static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_GET; public: LogicalGet(idx_t table_index, TableFunction function, unique_ptr bind_data, vector returned_types, vector returned_names); //! The table index in the current bind context idx_t table_index; //! The function that is called TableFunction function; //! The bind data of the function unique_ptr bind_data; //! The types of ALL columns that can be returned by the table function vector returned_types; //! The names of ALL columns that can be returned by the table function vector names; //! Bound column IDs vector column_ids; //! Columns that are used outside of the scan vector projection_ids; //! Filters pushed down for table scan TableFilterSet table_filters; //! The set of input parameters for the table function vector parameters; //! The set of named input parameters for the table function named_parameter_map_t named_parameters; //! The set of named input table types for the table-in table-out function vector input_table_types; //! The set of named input table names for the table-in table-out function vector input_table_names; //! For a table-in-out function, the set of projected input columns vector projected_input; string GetName() const override; string ParamsToString() const override; //! Returns the underlying table that is being scanned, or nullptr if there is none optional_ptr GetTable() const; public: vector GetColumnBindings() override; idx_t EstimateCardinality(ClientContext &context) override; void Serialize(FieldWriter &writer) const override; static unique_ptr Deserialize(LogicalDeserializationState &state, FieldReader &reader); vector GetTableIndex() const override; //! Skips the serialization check in VerifyPlan bool SupportSerialization() const override { return function.verify_serialization; }; protected: void ResolveTypes() override; }; } // namespace duckdb