evidence-dev / sqltools-bigquery-driver

Query and Explore BigQuery from VSCode
https://marketplace.visualstudio.com/items?itemName=Evidence.sqltools-bigquery-driver
MIT License
40 stars 5 forks source link

Query Cost Estimation with Dry Run #13

Open archiewood opened 1 year ago

archiewood commented 1 year ago

Dry run allows you to see how much data will be processed during your query

ASomerN commented 1 year ago

Really good to have BigQuery in VS Code, one of the only things missing for us is the ability to track the potential cost of the query (the dry run stats we would get in the GUI).

juanluisbf commented 1 year ago

Good job with the driver, I agree it would be really useful to see potential cost of the query before running it

Italosayan commented 11 months ago

I'm trying to scope this effort:

src/ls/driver.ts: -Add the dryRunQuery in the BigQueryDriver class

src/extension.ts: -Handle user triggering and output. I'm thinking: https://code.visualstudio.com/api/ux-guidelines/status-bar

vscode.window.setStatusBarMessage(`Dry run: ${result.bytesProcessed} bytes`, 5000);

It will have to be executed using the command palette. At least in this first approach.

archiewood commented 11 months ago

I'm thinking: https://code.visualstudio.com/api/ux-guidelines/status-bar

The status bar seems like a pretty sensible place for the output. (It's always visible unlike e.g. the extension sidebar)

It will have to be executed using the command palette.

You could also make the status bar element clickable to execute it I think?

For example, before dry run the status bar could say ► Dry Run Query, and then change to Dry Run: 12.5GB when clicked.

We do a similar thing in the Evidence VSCode extension

CleanShot 2023-11-30 at 12 38 19

banditelol commented 9 months ago

have anyone working on it?

I'm interested in working on this issue, since the scope is clear enough and I really need this feature

archiewood commented 9 months ago

No, you are welcome to it!

banditelol commented 9 months ago

Currently I'm still trying on several alternatives. While I could add new method into the driver.ts, I haven't figured out how to call this method from outside driver.ts (as sqltools seems like loading the files in src/ls/* dynamically).

I have tried importing vscode package to use the messaging part of it, but found this error:

ERROR: Error loading plugin BigQuery Driver for SQLTools Plugin Request ls/RegisterPlugin failed with message: Cannot find module 'vscode'

can you point me to any other resources for the next step?

archiewood commented 7 months ago

I'm afraid I haven't looked into this in detail, so I'm not clear on the best strategy.

I opened this issue on the main SQLtools repo, perhaps you could add some details and tag one of the maintainers?

https://github.com/mtxr/vscode-sqltools/issues/1191

vantaboard commented 6 months ago

Currently I'm still trying on several alternatives. While I could add new method into the driver.ts, I haven't figured out how to call this method from outside driver.ts (as sqltools seems like loading the files in src/ls/* dynamically).

I have tried importing vscode package to use the messaging part of it, but found this error:

ERROR: Error loading plugin BigQuery Driver for SQLTools Plugin Request ls/RegisterPlugin failed with message: Cannot find module 'vscode'

can you point me to any other resources for the next step?

Do you have your code available so I can pull it down and look into this error?