Skip to content
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

BigQuery: Add support for BEGIN #1718

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iffyio
Copy link
Contributor

@iffyio iffyio commented Feb 8, 2025

Adds support for the BEGIN ... EXCEPTION ... END syntax in BigQuery:

BEGIN
  SELECT 1;
  SELECT 2;
EXCEPTION WHEN ERROR THEN
  SELECT 3;
  SELECT 4;
END

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

@iffyio iffyio force-pushed the bq-begin-exception branch from 46f28fa to f3c803d Compare February 8, 2025 16:53
Copy link
Contributor

@yoavcloud yoavcloud left a comment

Choose a reason for hiding this comment

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

LGTM @iffyio. I recently added support for something similar in MS-SQL, but only for the case where there's a semi-colon after the BEGIN/END TRY/CATCH keywords. I think your approach of Vec<Statement> is better, and I'll align to that.

Adds support for the `BEGIN ... EXCEPTION ... END` syntax
in BigQuery:

```sql
BEGIN
  SELECT 1;
  SELECT 2;
EXCEPTION WHEN ERROR THEN
  SELECT 3;
  SELECT 4;
END
```

https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#beginexceptionend
@iffyio iffyio force-pushed the bq-begin-exception branch from f3c803d to f018574 Compare February 9, 2025 08:49
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