Skip to content

Conversation

chenkovsky
Copy link
Contributor

big query supports,

BEGIN [TRANSACTION];

but currently parse_statement is overwritten for bigquery, and this statement is not supported.

);
}

// https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#begin_transaction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#begin_transaction

Comment on lines 51 to 59
if parser.peek_keyword(Keyword::TRANSACTION) {
parser.prev_token();
return None;
}
let peek_token = parser.peek_token_ref();
if peek_token.token == Token::SemiColon || peek_token.token == Token::EOF {
parser.prev_token();
return None;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we merge both blocks with something like if parse.parse_keyword(BEGIN) || peek_token.token == SemiColon || peek_token.token == EOF

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @chenkovsky!
cc @alamb

@iffyio iffyio merged commit 865c191 into apache:main Jul 25, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants