//===----------------------------------------------------------------------===// // DuckDB // // duckdb/parser/query_node/select_node.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/parser/parsed_expression.hpp" #include "duckdb/parser/query_node.hpp" #include "duckdb/parser/sql_statement.hpp" #include "duckdb/parser/tableref.hpp" #include "duckdb/parser/parsed_data/sample_options.hpp" #include "duckdb/parser/group_by_node.hpp" #include "duckdb/common/enums/aggregate_handling.hpp" namespace duckdb { //! SelectNode represents a standard SELECT statement class SelectNode : public QueryNode { public: static constexpr const QueryNodeType TYPE = QueryNodeType::SELECT_NODE; public: DUCKDB_API SelectNode(); //! The projection list vector> select_list; //! The FROM clause unique_ptr from_table; //! The WHERE clause unique_ptr where_clause; //! list of groups GroupByNode groups; //! HAVING clause unique_ptr having; //! QUALIFY clause unique_ptr qualify; //! Aggregate handling during binding AggregateHandling aggregate_handling; //! The SAMPLE clause unique_ptr sample; const vector> &GetSelectList() const override { return select_list; } public: //! Convert the query node to a string string ToString() const override; bool Equals(const QueryNode *other) const override; //! Create a copy of this SelectNode unique_ptr Copy() const override; //! Serializes a QueryNode to a stand-alone binary blob void Serialize(FieldWriter &writer) const override; //! Deserializes a blob back into a QueryNode static unique_ptr Deserialize(FieldReader &reader); void FormatSerialize(FormatSerializer &serializer) const override; static unique_ptr FormatDeserialize(FormatDeserializer &deserializer); }; } // namespace duckdb