snowflakedb / dplyr-snowflakedb

SnowflakeDB backend for dplyr
Apache License 2.0
65 stars 25 forks source link

connecting to azure snowflake on osx #9

Open MattMacGillivray opened 5 years ago

MattMacGillivray commented 5 years ago

I'm unable to connect to snowflake using the example given:

library(dplyr)
library(dplyr.snowflakedb)
options(dplyr.jdbc.classpath = "/Users/mattm/downloads/snowflake-jdbc-3.6.9.jar")

my_db <- src_snowflakedb(user = "<user>",
                         password = "<password>",
                         account = "<account>",
                         opts = list(warehouse = "warehouse",
                                     db = "database",
                                     schema = "public"))

Error I get:

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 
  net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver not able to connect to Snowflake. Error code: 390100, Message: Incorrect username or password was specified..

Using:

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.6.0 (64-bit)

jdk1.8.0_152.jdk

Possibly relevant, I'm using a snowflake instance in east-us-2.azure

rdatasculptor commented 5 years ago

I encountered the same problem. A solution would be appreciated!

I am using a snowflake instance in west-europe.azure

MattMacGillivray commented 5 years ago

Response from Snowflake:

The issue is that the dplyr connector has not been updated to reflect the new lists of regions we've added since the last cut. We will likely deprecate that parameter to keep this easier going forward.

Could you add the following to your connection:

host = ".east-us-2.snowflakecomputing.com"

It would look something like this:

my_db <- src_snowflakedb(user = "test-user", password = "password", account = "myaccount", host = ".east-us-2.snowflakecomputing.com", opts = list(warehouse = "dba_wh", db = "sales", schema = "public"))

I tested that syntax and it worked whereas before it did not.

MattMacGillivray commented 5 years ago

Which seems to work.

rdatasculptor commented 5 years ago

So in my case it would be something like:

host = ".west-europe.snowflakecomputing.com"

Unfortenately that still doesn't work for me.

rdatasculptor commented 5 years ago

I didn't set the account name right. Now it works!