Skip to content

Allow with statements to specify their columns alongside their expression names #3716

@isidentical

Description

@isidentical

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
PostgreSQL (and many others) allow WITH statements to take a list of column aliases right after the CTE name.

WITH numbers(a, b, c) AS (
    SELECT 1, 2, 3
)
SELECT * FROM numbers;

DataFusion:

+----------+----------+----------+
| Int64(1) | Int64(2) | Int64(3) |
+----------+----------+----------+
| 1        | 2        | 3        |
+----------+----------+----------+

PostgreSQL:

 a | b | c 
---+---+---
 1 | 2 | 3

Describe the solution you'd like
DataFusion could also support this syntax, considering sqlparser-rs already parses and relays all the relevant information.

Describe alternatives you've considered
None

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions