Skip to content

Support SELECT * EXCEPT(col1, col2, ...) for BigQueryDialect #687

Closed

Description

@unvalley

I’d like to parse SELECT [* | column.*] EXCEPT(col1, col2, ...) FROM table using BigQueryDialect.

BigQuery Reference: https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select_except

The query SELECT * EXCEPT (col1, col2) FROM table causes ParserError as I described below.

use sqlparser::dialect::BigQueryDialect;
use sqlparser::parser::*;

fn main() {
    let sql = "SELECT * EXCEPT (col1, col2) FROM table";
    let dialect = BigQueryDialect {};
    let ast = Parser::parse_sql(&dialect, sql).unwrap();
    println!("AST: {:?}", ast);
}

// output: 
// thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParserError("Expected SELECT, VALUES, or a subquery in the query body, found: col1")', examples/parse_select.rs:21:48...

Activity

  1. changed the title [-]Support `SELECT * EXCEPT(col1, col2, ...)` for BigQuery[/-] [+]Support `SELECT * EXCEPT(col1, col2, ...)` for BigQueryDialect[/+] on Oct 25, 2022
  2. AugustoFKL commented on Nov 21, 2022

    @AugustoFKL
    Contributor

    @unvalley are you working on this already?

    I just worked on EXCLUDE from snowflake on #721, and it seems like a really similar syntax. I can work on that as well.

  3. unvalley commented on Nov 21, 2022

    @unvalley
    ContributorAuthor

    @AugustoFKL I'm not working on this.

    I just worked on EXCLUDE from snowflake on #721, and it seems like a really similar syntax. I can work on that as well.

    Thanks! That helps a lot.

  4. AugustoFKL commented on Nov 21, 2022

    @AugustoFKL
    Contributor

    Sure, I'll do that then. I just need to have my 5 PRs merged hahaha, otherwise I'll start pilling up conflicts, which I don't have the love of solving.

    Once 2 or 3 are merged, I can go on that. Does that work for you?

  5. unvalley commented on Nov 21, 2022

    @unvalley
    ContributorAuthor

    @AugustoFKL No problem at all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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