Skip to content

Commit

Permalink
bigquery: Value::Tuple as used in OPTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
lustefaniak committed Mar 26, 2024
1 parent cb82ad9 commit 74933be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5266,6 +5266,7 @@ impl<'a> Parser<'a> {
}
Token::LParen => {
let values = self.parse_comma_separated(Parser::parse_value)?;
self.expect_token(&Token::RParen)?;
if values.len() == 1 {
Ok(values.into_iter().next().unwrap())
} else {
Expand Down
6 changes: 6 additions & 0 deletions tests/sqlparser_bigquery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,3 +1314,9 @@ fn test_alter_table_alter_column_set_options() {
bigquery()
.verified_stmt("ALTER TABLE mydataset.mytable ALTER COLUMN price SET OPTIONS(description = 'Price per unit')");
}

#[test]
fn test_alter_set_options_labels_tuple() {
bigquery()
.verified_stmt("ALTER SCHEMA mydataset SET OPTIONS (labels = [('sensitivity', 'high')])");
}

0 comments on commit 74933be

Please sign in to comment.