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

[SIP-88] BigQuery Estimate Cost Button for SQL Lab #20832

Closed
zamar-roura opened this issue Jul 22, 2022 · 3 comments
Closed

[SIP-88] BigQuery Estimate Cost Button for SQL Lab #20832

zamar-roura opened this issue Jul 22, 2022 · 3 comments
Labels
sip Superset Improvement Proposal

Comments

@zamar-roura
Copy link
Contributor

zamar-roura commented Jul 22, 2022

[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.

@zamar-roura
Copy link
Contributor Author

zamar-roura commented Jul 22, 2022

I have the code working, should I give a PR to develop? Thanks for reading ^^

@john-bodley john-bodley added the sip Superset Improvement Proposal label Jun 7, 2023
@rusackas
Copy link
Member

rusackas commented Oct 3, 2023

It seems the linked PR effectively closes and completes this SIP. Let me know if there's anything else left to be done here, and we can revisit this.

@rusackas rusackas closed this as completed Oct 3, 2023
@rusackas
Copy link
Member

rusackas commented Oct 3, 2023

Noting for posterity that while the work was implemented, the SIP itself did not go through the discuss/vote process on the Apache mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sip Superset Improvement Proposal
Projects
Status: Implemented / Done
Development

No branches or pull requests

3 participants