Skip to content

[FEATURE] Support for FULL OUTER UNION ALL BY NAME (Big Query) #2208

Open
@SusanaCastela

Description

@SusanaCastela

Grammar or Syntax Description

BigQuery supports a non-standard extension to UNION ALL that includes FULL OUTER UNION ALL BY NAME. This construct allows combining multiple SELECT queries by matching column names instead of relying on column order, and filling in NULLs for missing columns.

Currently, JSQLParser does not support parsing this syntax. It results in the following error:
net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "FULL"

SQL Example

  • Simplified Query Example, focusing on the failing feature:
    SELECT 1 as b FULL OUTER UNION ALL BY NAME SELECT 2 as a

Additional context

Database/Platform: Google BigQuery

Official Docs:
https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#union

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions