No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command

I've configured a snowflake resources

Connection test is successful.

Here is the Snowflake setup

Now I go to create an app

So let's USE WAREHOUSE COMPUTE_WH

If I run each of these statement, one at a time - first select current_warehouse() and then, select * from hello_world I get back results.

What am I missing? Aren't i setting the default warehouse in the resource connector?
When someone is writing an app how can I make it so they use the compute_wh?

To further complicate things - My retool user has COMPUTE_WH as the default warehouse.

Thanks.

Hello @bithippie!

Apologies for this issue. You are correct, the query should definitely be using the 'Database warehouse' as defined in the Resource set up.

It looks like currently, select current_warehouse() is needed inside the SQL query followed by the action to perform on the table. Once I reproduce this I can file a bug report to let our engineers know that the SQL option for Snowflake queries is incorrectly throwing that error.

To your third question "When someone is writing an app how can I make it so they use the compute_wh?" is that not what you were able to do in your fifth image? Maybe I am misunderstanding :sweat_smile:

I believe for now you will need to do exactly what you are doing and preface the SQL query with SELECT CURRENT_WAREHOUSE but I will do some testing to doublecheck this since if there are multiple tables in the warehouse then we need to know how to specify them.

Thanks @Jack_T.

Glad to know it's not me.

Replying to your question -

When someone is writing an app how can I make it so they use the compute_wh?

What I should have said is -

How can I make it so they use the compute_wh without having to remember to run the first sql command select current_warehouse()

Ah ok, makes sense :sweat_smile:

On our cloud instance for testing, I was able to run SQL mode queries to a snowflake instance without needing to specify the warehouse besides having the warehouse set in the resource set up :thinking:

So I am not how how to reproduce the 'no active warehouse selected' error message :sweat:

What version of self hosted are you running? Maybe updating to a newer version will get us to a point where this bug was resolved.

For now, if you can't update the version. The workaround where you use SELECT CURRENT_WAREHOUSE() might be the solution for all queries to get around that error.