Feature: Limit billable bytes per query; Add estimated cost display #245
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
As an admin, I may want to control the cost of my query spend. With the BigQuery client this can be done by specifying the
MaxBytesBilled
on theQueryConfig
. Also, I know what our on demand compute price is and would like to estimate the cost of running a query at validation time so that my users can conceptualize what their queries cost and consider optimizing them.Description
This PR adds two optional configuration fields to the datasource:
maxBillableBytes
: Applied to the queryconfig on the backend to prevent large queries from runningonDemandComputePrice
: Strictly used for display purposes on the frontend gives the user an approximate cost of running their query to 4 decimal places. Since the price is per terabyte 4 decimal places gives better visibility to smaller queries.