mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-24 16:04:04 +00:00
Allow empty options for BigQuery (#1657)
Co-authored-by: Martin Abelson Sahlen <sahlen@Mac.lan>
This commit is contained in:
parent
36db176657
commit
9105cae261
2 changed files with 7 additions and 1 deletions
|
@ -7341,7 +7341,7 @@ impl<'a> Parser<'a> {
|
||||||
pub fn parse_options(&mut self, keyword: Keyword) -> Result<Vec<SqlOption>, ParserError> {
|
pub fn parse_options(&mut self, keyword: Keyword) -> Result<Vec<SqlOption>, ParserError> {
|
||||||
if self.parse_keyword(keyword) {
|
if self.parse_keyword(keyword) {
|
||||||
self.expect_token(&Token::LParen)?;
|
self.expect_token(&Token::LParen)?;
|
||||||
let options = self.parse_comma_separated(Parser::parse_sql_option)?;
|
let options = self.parse_comma_separated0(Parser::parse_sql_option, Token::RParen)?;
|
||||||
self.expect_token(&Token::RParen)?;
|
self.expect_token(&Token::RParen)?;
|
||||||
Ok(options)
|
Ok(options)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -473,6 +473,12 @@ fn parse_create_table_with_options() {
|
||||||
r#"description = "table option description")"#
|
r#"description = "table option description")"#
|
||||||
);
|
);
|
||||||
bigquery().verified_stmt(sql);
|
bigquery().verified_stmt(sql);
|
||||||
|
|
||||||
|
let sql = "CREATE TABLE foo (x INT64) OPTIONS()";
|
||||||
|
bigquery().verified_stmt(sql);
|
||||||
|
|
||||||
|
let sql = "CREATE TABLE db.schema.test (x INT64 OPTIONS(description = 'An optional INTEGER field')) OPTIONS()";
|
||||||
|
bigquery().verified_stmt(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue