Search code examples
snowflake-cloud-data-platformapache-drill

Connecting Apache Drill with Snowflake DB


I am trying to connect Apache Drill to query Snowflake data warehouse. I was able to successfully create a snowflake storage plugin in Drill web UI with JSON structure as below. But I am not able to either explore the tables in the schema in the explorer nor query the tables. I am using Snowflake JDBC driver from their site: https://docs.snowflake.net/manuals/user-guide/jdbc-configure.html#examples

What am I doing wrong?

{
 "type": "jdbc",
 "driver": "net.snowflake.client.jdbc.SnowflakeDriver",
  "url": "jdbc:snowflake://accountname.snowflakecomputing.com/? 
    warehouse=wh&db=test_db&schema=test_schema",
  "username": "user",
  "password": "pwd",
  "caseInsensitiveTableNames": false,
  "enabled": true
  }

Solution

  • I am able to connect to snowflake DB and Query the table:

    My Storage Plugin config is:

    {
      "name" : "snowflake",
      "config" : {
        "type" : "jdbc",
        "driver" : "net.snowflake.client.jdbc.SnowflakeDriver",
        "url" : "jdbc:snowflake://Account.eu-central-1.snowflakecomputing.com/?warehouse=Compute_WH&db=Anshul_DB&schema=Anshul_SC",
        "username" : “User",
        "password" : “Password",
        "caseInsensitiveTableNames" : false,
        "enabled" : true
      }
    }
    

    Once I set up the Storage Plugin I used the command Show databases and I am able to see Snowflake Databases. Then used to USE command to set Default Schema to my snowflake Schama Use snowflake_anshulsc Then tried running the command: Show tables in snowflake.anshul_sc Go the Table name

    Then To query the table use the below command;

    select * from snowflake.anshul_sc.T1