| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/main/relation/projection_relation.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/main/relation.hpp" |
| 12 | #include "duckdb/parser/parsed_expression.hpp" |
| 13 | |
| 14 | namespace duckdb { |
| 15 | |
| 16 | class ProjectionRelation : public Relation { |
| 17 | public: |
| 18 | DUCKDB_API ProjectionRelation(shared_ptr<Relation> child, vector<unique_ptr<ParsedExpression>> expressions, |
| 19 | vector<string> aliases); |
| 20 | |
| 21 | vector<unique_ptr<ParsedExpression>> expressions; |
| 22 | vector<ColumnDefinition> columns; |
| 23 | shared_ptr<Relation> child; |
| 24 | |
| 25 | public: |
| 26 | unique_ptr<QueryNode> GetQueryNode() override; |
| 27 | |
| 28 | const vector<ColumnDefinition> &Columns() override; |
| 29 | string ToString(idx_t depth) override; |
| 30 | string GetAlias() override; |
| 31 | }; |
| 32 | |
| 33 | } // namespace duckdb |
| 34 |