You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/03/09 09:36:50 UTC
(datafusion-sqlparser-rs) branch main updated: Fixed parsing `OPTIONS(format = 'CSV')` when creating external bigquery table (#2268)
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 3fa71143 Fixed parsing `OPTIONS(format = 'CSV')` when creating external bigquery table (#2268)
3fa71143 is described below
commit 3fa71143b5a3bd5c97dc94999e0a1652fefd389f
Author: Andriy Romanov <ar...@montecarlodata.com>
AuthorDate: Mon Mar 9 02:28:09 2026 -0700
Fixed parsing `OPTIONS(format = 'CSV')` when creating external bigquery table (#2268)
---
src/parser/mod.rs | 2 ++
tests/sqlparser_bigquery.rs | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index f9432f86..274449ff 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -6297,6 +6297,8 @@ impl<'a> Parser<'a> {
let table_properties = self.parse_options(Keyword::TBLPROPERTIES)?;
let table_options = if !table_properties.is_empty() {
CreateTableOptions::TableProperties(table_properties)
+ } else if let Some(options) = self.maybe_parse_options(Keyword::OPTIONS)? {
+ CreateTableOptions::Options(options)
} else {
CreateTableOptions::None
};
diff --git a/tests/sqlparser_bigquery.rs b/tests/sqlparser_bigquery.rs
index ce962cb8..a6b0906f 100644
--- a/tests/sqlparser_bigquery.rs
+++ b/tests/sqlparser_bigquery.rs
@@ -591,6 +591,16 @@ fn parse_create_table_with_options() {
bigquery().verified_stmt(sql);
}
+#[test]
+fn parse_create_external_table_with_options() {
+ bigquery().verified_stmt(
+ "CREATE EXTERNAL TABLE dataset_id.table1 (hvr_tx_seq STRING) OPTIONS(format = 'CSV')",
+ );
+ bigquery().verified_stmt(
+ "CREATE EXTERNAL TABLE dataset_id.table1 (hvr_tx_seq STRING) OPTIONS(format = 'CSV', allow_quoted_newlines = true, encoding = 'UTF8')",
+ );
+}
+
#[test]
fn parse_nested_data_types() {
let sql = "CREATE TABLE table (x STRUCT<a ARRAY<INT64>, b BYTES(42)>, y ARRAY<STRUCT<INT64>>)";
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org