Problems with snowflake setup -


#1

I’m trying to set up snowflake as a storage target, but I’ve had a few problems with the setup.

Initially I got the error:

SnowflakeSQLException: Cannot perform CREATE SCHEMA. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.

So I tried a qualified name for the schema in the snowflake config JSON and now get:

Exception in thread "main" net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error:
Database 'SNOWPLOW_TEST' does not exist.

Even though I have created the database.

Any suggestions as to what I’m doing wrong?


#2

Hi @iain,

Did you have an existing database when you used non-qualified schema name?

When you’re running snowplow-snowflake-loader setup you need to use non-qualified name (e.g. atomic) and have an existing database.


#3

Hi Anton,

I have created an empty database and granted all permissions to a role for the username I’ve specified in the config. However when I run it with a non-qualified name, I get:

Exception in thread "main" net.snowflake.client.jdbc.SnowflakeSQLException: Cannot perform CREATE SCHEMA. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.

as an error


#4

This is very strange. Is it just single line in output or loader gives a full JVM traceback?


#5

The full traceback is:

Setting up...
Exception in thread "main" net.snowflake.client.jdbc.SnowflakeSQLException: Cannot perform CREATE SCHEMA. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:102)
at net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:410)
at net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:371)
at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:195)
at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:147)
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:529)
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:158)
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:91)
at com.snowplowanalytics.snowflake.loader.connection.Jdbc$.executeAndOutput(Jdbc.scala:88)
at com.snowplowanalytics.snowflake.loader.Initializer$.run(Initializer.scala:29)
at com.snowplowanalytics.snowflake.loader.Main$.main(Main.scala:25)
at com.snowplowanalytics.snowflake.loader.Main.main(Main.scala)

#6

Sorry, I’m completely lost about this. The only things I can suggest are: check if region matches in Console and config or try to re-create the DB.

Also, queries should be shown in Console’s history even if they failed. Would it it possible to check if they’re present there and may be try to re-run them right there.


#10

Thanks, I’ve run the queries manually for now, but I’ll have another go later on and report back


#11

Thanks @iain. Please, keep us posted.