Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Snowflake offers ODBC driver which make Iguana connecting to snowflake easily. See detail below

...

Architecture Design

...

ODBC Setup

  • Download and Install ODBC Driver: https://developers.snowflake.com/odbc/

  • Collect the following Snowflake Configurations for ODBC:

    • Server URL: XXX.snowflakecomputing.com

    • User Credentials (username and password)

    • User Role (ex. ACCOUNTADMIN)

    • Warehouse Name (ex. COMPUTE_WH)

    • Database name

    • Database Schema

  • Image Added
  • Once setup, click on Test and receive success notification

    Image Added

Iguana Translator Sample

Code Block
languagelua
-- The main function is the first function called from Iguana.
function main()
   
   local conn = db.connect{   
      api=db.ACCESS, -- "ODBC Cheat" - this (or another ODBC connection type) will work with most ODBC connections
      name='Snowflake',
      user='Test', 
      password='Password',
      use_unicode = true,
      live = true
   }
 
   local sqlStr = [==[
   SELECT
l_returnflag,
l_linestatus,
count(*) as count_order
FROM
lineitem
WHERE
l_shipdate <= dateadd(day, -90, to_date('1998-12-01'))
GROUP BY
l_returnflag,
l_linestatus]==]
   
   
   local res = conn:query{sql=sqlStr, live=true}
end