-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for validate_sql method to BigQuery (#819)
In CLI contexts MetricFlow will issue dry run queries as part of its warehouse validation operations, and so we are adding a validate_sql method to all adapters. This commit adds support for the validate_sql method to BigQuery. It does so by creating a BigQuery-specific `dry_run` method on the BigQueryConnectionManager. This simply passes through the input SQL with the `dry_run` QueryJobParameter flag set True. This will result in BigQuery computing and returning a cost estimate for the query, or raising an exception in the event the query is not valid. Note: constructing the response object involves some repetitive value extraction from the QueryResult returned by BigQuery. While I would ordinariy prefer to tidy this up first we are pressed for time, and so we postpone that cleanup in order to keep this change as isolated as possible.
- Loading branch information
Showing
4 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Add validate_sql to BigQuery adapter and dry_run to BigQueryConnectionManager | ||
time: 2023-07-12T01:43:50.36167-04:00 | ||
custom: | ||
Author: tlento | ||
Issue: "805" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters