Solved

Snowflake Datasource

  • 23 February 2022
  • 10 replies
  • 90 views

I am trying to connect to snowflake.

In snowflake I have a database called DATACLOUD. 

If I do describe warehouses I have only one called COMPUTE_WH

So I created a datasource with the following jdbc

jdbc:snowflake://<my account info here>.snowflakecomputing.com/?warehouse=COMPUTE_WH&db=DATACLOUD

But when I hit scan it says: “There are no tables in the schema”

I assume my jdbc url is wrong, but I have no idea what the issue is.

icon

Best answer by Moises Morales 25 February 2022, 01:22

View original

10 replies

Userlevel 2

Hi Chanan, 

 

It looks like your JDBC URL is not constructed properly, can you please make sure it follows this format: 

jdbc:snowflake://<db_account>.snowflakecomputing.com:<db_port>?warehouse=<db_warehouse>&db=<db_name>

E.g.: jdbc:snowflake://moises.snowflakecomputing.com:443?warehouse=EXPLORER&db=GD&schema=TEST

 

Let me know if this helps.

 

-Moises

Hi,

Looks like port 443 is the default so i didnt include. Just to be sure i did now, but it didnt help.

Schema is not an allowed keyword according to Gooddata:

{

    "detail": "InvalidParameters: Invalid parameters keys: [schema]",

    "status": 400,

    "title": "Bad Request",

    "traceId": "454e5db758b1e3b2"

}

Userlevel 2

Could you provide the body of the query you are making? Also, could you confirm if this is in the UI or on GD.CN? From first glance it may look like you are providing the incorrect schema parameter. 

This is the API request i used to create the datasource:

{
      "data": {
          "attributes": {
              "name": "datacloud-ds",
              "url": "jdbc:snowflake://<my account>.snowflakecomputing.com:443/?warehouse=COMPUTE_WH&db=DATACLOUD",
              "schema": "datacloud",
              "type": "SNOWFLAKE",
              "username": "<my user>",
              "password": "<my password>"
          },
          "id": "datacloud-ds",
          "type": "dataSource"
      }
  }

I am creating the above datasource in the api, then in the UI I click the scan button in the LDM screen.

 

I know my account info and credentials are correct, because if I put wrong information in, I get an error back in the Gooddata UI when I hit scan. So, GoodData is connecting to my snowflake account. I have 3 tables in that account / database. I am able to see them in snowflake and query them to get data.

Userlevel 2

Thanks for this. Would it be possible to provide a screenshot of your Snowflake so we can compare the API call?

Is this the info you are looking for?

 

Userlevel 2

It looks like you need to change your schema to be either information_schema or public. Could you try this, and let us know if it helps?

I am not sure what you mean by change my schema to public (my tables are in public). The GoodData API does not allow using schema in the JDBC url. So how do I do that exactly?

Userlevel 2

I see you have defined "schema": "datacloud", however, there isn’t any schema with this name in your database. Can you please double check? 

Thanks! Now I understand, schema in the body is instead of schema in the jdbc url. That worked.

Reply