Skip to content

Commit b9b1edc

Browse files
committed
Revert OPTIONS/TBLPROPERTIES reorder in parse_create_external_table
The pre-existing maybe_parse_options(OPTIONS) fallback already handled BigQuery OPTIONS(...) on external tables; the reorder made it unreachable without changing behavior.
1 parent 4df2961 commit b9b1edc

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

src/parser/mod.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6417,27 +6417,13 @@ impl<'a> Parser<'a> {
64176417
};
64186418
let location = hive_formats.as_ref().and_then(|hf| hf.location.clone());
64196419

6420-
// BigQuery external tables support `WITH CONNECTION <name>` and `OPTIONS(...)`
6421-
// clauses after the (optional) column list.
64226420
let with_connection = if self.parse_keywords(&[Keyword::WITH, Keyword::CONNECTION]) {
64236421
Some(self.parse_object_name(false)?)
64246422
} else {
64256423
None
64266424
};
6427-
// BigQuery uses OPTIONS(...); Hive uses TBLPROPERTIES(...). They are
6428-
// mutually exclusive in practice, and `parse_options` returns an empty
6429-
// vec when the keyword isn't present, so trying OPTIONS first and
6430-
// falling back to TBLPROPERTIES preserves the existing Hive path
6431-
// without accepting both in the same statement.
6432-
let options = self.parse_options(Keyword::OPTIONS)?;
6433-
let table_properties = if options.is_empty() {
6434-
self.parse_options(Keyword::TBLPROPERTIES)?
6435-
} else {
6436-
vec![]
6437-
};
6438-
let table_options = if !options.is_empty() {
6439-
CreateTableOptions::Options(options)
6440-
} else if !table_properties.is_empty() {
6425+
let table_properties = self.parse_options(Keyword::TBLPROPERTIES)?;
6426+
let table_options = if !table_properties.is_empty() {
64416427
CreateTableOptions::TableProperties(table_properties)
64426428
} else if let Some(options) = self.maybe_parse_options(Keyword::OPTIONS)? {
64436429
CreateTableOptions::Options(options)

0 commit comments

Comments
 (0)