Problems with snowflake setup -

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?

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.

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

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

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)

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.

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

Thanks @iain. Please, keep us posted.

I’m getting the exact same error when running snowplow-snowflake-loader-0.3.1.jar setup.
I’ve manually run the queries to create atomic schema and atomic.events table.

Not sure where I can find the queries that would create:

  • File format
  • External Stage
  • Virtual Warehouse

Any help would be greatly appreciated!

Actually, was able to run setup successfully after giving the snowflake user SYSADMIN role…
So it’s all good, thanks!