Skip to content

HogQL: Support for CTEs in a union query #20663

@thmsobrmlr

Description

@thmsobrmlr

Is your feature request related to a problem?

A CTE is only accessible from the first query in a union query.

WITH test AS (SELECT 123 AS value)
SELECT value FROM test
UNION ALL
SELECT value FROM test
Screenshot 2024-03-01 at 13 50 07

Describe the solution you'd like

CTEs should be handled in the same way ClickHouse does.

Describe alternatives you've considered

Repeating the CTE for each query.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions