Skip to content

fix: begin statement for bigquery#1975

Merged
iffyio merged 2 commits intoapache:mainfrom
chenkovsky:fix/begin_transaction
Jul 25, 2025
Merged

fix: begin statement for bigquery#1975
iffyio merged 2 commits intoapache:mainfrom
chenkovsky:fix/begin_transaction

Conversation

@chenkovsky
Copy link
Copy Markdown
Contributor

big query supports,

BEGIN [TRANSACTION];

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

Comment thread tests/sqlparser_bigquery.rs Outdated
);
}

// https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#begin_transaction
Copy link
Copy Markdown
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 thread src/dialect/bigquery.rs Outdated
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
Copy Markdown
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
Copy Markdown
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
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Feb 3, 2026
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