question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BigQuery: bytes processed should be logged for all dbt commands that perform queries

See original GitHub issue

Describe the feature

With the release of dbt 0.18.0, launching a dbt run command against a bigquery database will output the bytes processed when a model is successfully deployed. However, to get a full picture of the amount of bytes dbt processes on bigquery (and hence to get an idea of the cost of running a specific dbt command), this should also be logged when launching dbt test, dbt source snapshot-freshness and dbt run-operation commands.

Additional context

For dbt run commands, this feature was discussed in #2526, it would be nice to extend this to also log this number for the other commands mentioned above.

Who will this benefit?

This is a bigquery specific issue.

Are you interested in contributing this feature?

Sure, happy to see how we could add this.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jtcohen6commented, Dec 17, 2020

#2961 adds an adapter-specific dict to run_results.json. Let’s consider that a partway resolution to this issue; meanwhile, I’ll open a new issue to address the desire for recording bytes_processed for queries from other invocation types—namely dbt test—which we can revisit for v0.20.0.

0reactions
jtcohen6commented, Oct 6, 2020

IIRC, after discussing this live, we decided we’d opt for:

an unstructured dict of result data … populated on a per-adapter basis. The adapter is responsible for generating the status text and any extra result data it might think is appropriate, then that gets decorated with any task-specific result data that might be appropriate.

The trickiness will be in surfacing that data to stdout. While this isn’t a blocker for #2493, it’s highly related. I’m removing “good first issue” and “bigquery”—this gets into our core plumbing—and pulling it into v0.19.

Edit: Eventually, we may want this to be a list of dictionaries (query_stats). One model/materialization may include multiple queries and we’d want to collect stats for all of them. This isn’t something we do a good job of today in run results more generally.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BigQuery: bytes processed should be logged for all dbt ...
Describe the feature With the release of dbt 0.18.0, launching a dbt run command against a bigquery database will output the bytes processed...
Read more >
Control costs in BigQuery - Google Cloud
This page describes best practices for controlling costs in BigQuery. BigQuery has two pricing models for running queries:.
Read more >
Logging dbt jobs in BigQuery - Medium
In order to log all jobs run by dbt on BigQuery, ... slot time for their jobs and how much bytes they are...
Read more >
BigQuery setup - dbt Developer Hub
When a maximum_bytes_billed value is configured for a BigQuery profile, queries executed by dbt will fail if they exceed the configured maximum ...
Read more >
DBT : Access Denied to Table dbt-tutorial:jaffle_shop.orders
yml and set "treatment location" to "US" when you create your Big Query account (if not you will have a 404 error). If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found