https://meltano.com/ logo
#announcements
Title
# announcements
w

wide-motorcycle-73593

03/09/2021, 2:37 PM
Hi all - I'm trying to do a hello-world experiment running from Postgres to Snowflake, but keep getting an error
snowflake.connector.errors.ProgrammingError: 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.
for queries like
Copy code
SELECT column_name, data_type, is_nullable
            FROM "RAW_MELTANO".information_schema.columns
            WHERE table_schema = 'TAP_POSTGRES' AND table_name = 'PUBLIC_TEST7'
I have a warehouse configured, it's the user's default warehouse, etc - any ideas?
s

salmon-salesclerk-77709

03/09/2021, 2:40 PM
Does the role you’re using have the operate and usage permissions on the warehouse? That’s typically where I’ve seen this error come up (outside of the Meltano context though)
Even if a warehouse is assigned as the default, it’s possible to not have the proper permissions to actually use it - which seems weird on Snowflake’s part.
w

wide-motorcycle-73593

03/09/2021, 2:49 PM
yeah, it does. if i log in as that user, i can run the query just fine.
(with the same warehouse, etc)
s

salmon-salesclerk-77709

03/09/2021, 2:53 PM
is the warehouse in the meltano.yml configured with all caps? I had a similar challenge when the names weren’t matching up because of Snowflake’s capitalization
w

wide-motorcycle-73593

03/09/2021, 2:57 PM
Hmm, that might be it. Getting a different error now, at least. Thank you!
hey, it worked! OK! Nifty.
r

ripe-musician-59933

03/09/2021, 3:40 PM
We already automatically upcase the Snowflake schema: https://gitlab.com/meltano/meltano/blob/master/src/meltano/core/bundle/discovery.yml#L1587, but don't do so yet for the warehouse! Should we do this automatically for username, database, and warehouse as well?
s

salmon-salesclerk-77709

03/09/2021, 4:41 PM
Most likely yes. We’d have to stare at the naming conventions a bit to be confident in it. For permifrost we have this function which converts names to snowflake identifiers. We could repurpose that I think https://gitlab.com/gitlab-data/permifrost/-/blob/master/src/permifrost/core/permissions/utils/snowflake_connector.py#L320