Skip to content

fix: begin statement for bigquery #1975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2025
Merged

Conversation

chenkovsky
Copy link
Contributor

big query supports,

BEGIN [TRANSACTION];

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

@@ -2566,3 +2566,14 @@ fn test_struct_trailing_and_nested_bracket() {
)
);
}

// 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