//===----------------------------------------------------------------------===// // DuckDB // // duckdb/planner/bound_query_node.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/planner/expression.hpp" #include "duckdb/planner/bound_result_modifier.hpp" #include "duckdb/parser/query_node.hpp" namespace duckdb { //! Bound equivalent of QueryNode class BoundQueryNode { public: explicit BoundQueryNode(QueryNodeType type) : type(type) { } virtual ~BoundQueryNode() { } //! The type of the query node, either SetOperation or Select QueryNodeType type; //! The result modifiers that should be applied to this query node vector> modifiers; //! The names returned by this QueryNode. vector names; //! The types returned by this QueryNode. vector types; public: virtual idx_t GetRootIndex() = 0; public: template TARGET &Cast() { if (type != TARGET::TYPE) { throw InternalException("Failed to cast bound query node to type - query node type mismatch"); } return reinterpret_cast(*this); } template const TARGET &Cast() const { if (type != TARGET::TYPE) { throw InternalException("Failed to cast bound query node to type - query node type mismatch"); } return reinterpret_cast(*this); } }; } // namespace duckdb