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

Query Cost Estimation with Dry Run #13

Open
archiewood opened this issue Aug 17, 2023 · 9 comments
Open

Query Cost Estimation with Dry Run #13

archiewood opened this issue Aug 17, 2023 · 9 comments

Comments

@archiewood
Copy link
Member

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

@ASomerN
Copy link

ASomerN commented Sep 26, 2023

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
Copy link

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

@archiewood archiewood changed the title Dry Run Query Cost Estimation with Dry Run Nov 30, 2023
@Italosayan
Copy link

Italosayan commented Nov 30, 2023

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
Copy link
Member Author

archiewood commented Nov 30, 2023

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
Copy link

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
Copy link
Member Author

No, you are welcome to it!

@banditelol
Copy link

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
Copy link
Member Author

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?

mtxr/vscode-sqltools#1191

@vantaboard
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants