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

Add support for validate_sql method to BigQuery #819

Merged
merged 1 commit into from
Jul 12, 2023

Commits on Jul 12, 2023

  1. Add support for validate_sql method to BigQuery

    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.
    tlento committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    0e79408 View commit details
    Browse the repository at this point in the history