This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-2439-d920e66649395bbd7d0dce0823dd9c302c13af69 in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
commit 7076b7989ed6f5fc6fc048b8babb8b02b1733e5c Author: Mosha Pasumansky <[email protected]> AuthorDate: Thu Aug 20 13:25:54 2026 +0000 BigQuery: enable FROM-first SELECT (#2439) Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Ifeanyi Ubah <[email protected]> --- src/dialect/bigquery.rs | 8 ++++++++ tests/sqlparser_bigquery.rs | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/dialect/bigquery.rs b/src/dialect/bigquery.rs index 544be23e..d34be9a4 100644 --- a/src/dialect/bigquery.rs +++ b/src/dialect/bigquery.rs @@ -136,6 +136,14 @@ impl Dialect for BigQueryDialect { true } + /// BigQuery allows a query to start with `FROM` (e.g. `FROM t`, and the + /// entry form for pipe syntax, `FROM t |> ...`). + /// + /// See <https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#from_queries> + fn supports_from_first_select(&self) -> bool { + true + } + /// See <https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#execute_immediate> fn supports_execute_immediate(&self) -> bool { true diff --git a/tests/sqlparser_bigquery.rs b/tests/sqlparser_bigquery.rs index f6d4483c..97f71cfe 100644 --- a/tests/sqlparser_bigquery.rs +++ b/tests/sqlparser_bigquery.rs @@ -2950,3 +2950,10 @@ fn test_create_snapshot_table() { "CREATE SNAPSHOT TABLE IF NOT EXISTS dataset_id.table1 CLONE dataset_id.table2 FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR) OPTIONS(expiration_timestamp = TIMESTAMP '2025-01-01 00:00:00 UTC')", ); } + +#[test] +fn parse_from_first_select() { + bigquery().verified_stmt("FROM t"); + bigquery().verified_stmt("FROM t SELECT a, b"); + bigquery().verified_stmt("FROM t |> WHERE a > 1 |> SELECT a"); +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
