You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently no estimate cost button for Bigquery schemas. Before running a query it would be good to know how many bytes will be processed. In EUW 1TB = 5€ aprox.
Proposed Change
We are adding four methods inside superset/db_engine_specs/bigquery.py
For now only Postgres and Presto had cost estimation capabilities. For that they used the cursor object.
Bigquery needs to use a dry run to get the query cost estimation. Sadly, you can't use the cursor to execute dry runs (I have tried). And that's why there is a need to override the two functions. estimate_statement_cost and estimate_query_cost. The other two methods get_allow_cost_estimate and query_cost_formatter are just added because the base class doesn't have functionality or gives a False.
Also the QueryEditor.py object doesn't have sqlEditorId anymore in it's variables and the Cost Estimation Reducer is looking for it, thus giving error, that is also changed.
[SIP-88] BigQuery Estimate Cost Button SQL Lab
Motivation
There is currently no estimate cost button for Bigquery schemas. Before running a query it would be good to know how many bytes will be processed. In EUW 1TB = 5€ aprox.
Proposed Change
We are adding four methods inside superset/db_engine_specs/bigquery.py
For now only Postgres and Presto had cost estimation capabilities. For that they used the cursor object.
Bigquery needs to use a dry run to get the query cost estimation. Sadly, you can't use the cursor to execute dry runs (I have tried). And that's why there is a need to override the two functions. estimate_statement_cost and estimate_query_cost. The other two methods get_allow_cost_estimate and query_cost_formatter are just added because the base class doesn't have functionality or gives a False.
Also the QueryEditor.py object doesn't have sqlEditorId anymore in it's variables and the Cost Estimation Reducer is looking for it, thus giving error, that is also changed.
New or Changed Public Interfaces
Add method with arguments:
estimate_statement_cost(cls, statement: str, database: "Database" )
New dependencies
Not needed.
Migration Plan and Compatibility
Not needed.
Rejected Alternatives
None yet.
The text was updated successfully, but these errors were encountered: