Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Super Collaborator

This article explains how to connect to Snowflake from Cloudera Machine Learning.

 

  1. Save your Snowflake password for your account.
    Go to Account Settings > Environment Variables and create a new entry with Name: "SNOW_PASSWORD" and Value: <your password>peter_ableda_3-1649340312919.png
  2. Create a new session in your CML Project. You can use any of the editors, and a Python kernel:peter_ableda_2-1649340024388.png

  3. Install required Python packages
    pip install pandas snowflake-connector-python snowflake-connector-python[pandas]
  4. Initiate the Snowflake connection.
    You need to set your Snowflake Account ID and your username for the connection. Your Snowflake password is retrieved from the environment variable that you configured in the Account Settings. I'm using the default Snowflake warehouse and a sample database/schema.
    import os 
    import pandas as pd
    import snowflake.connector
    
    conn = snowflake.connector.connect(
        account='<Account ID>',
        user='<Username>',
        password=os.environ['SNOW_PASSWORD'],
        warehouse='COMPUTE_WH',
        database='SNOWFLAKE_SAMPLE_DATA',
        schema='TPCH_SF1'
    )
    
    query = '''
    select * from SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.CUSTOMER limit 100
    '''
    
    pd.read_sql(query, conn)
  5. Once you execute the code, you can see the results:peter_ableda_1-1649339461033.png
2,237 Views
0 Kudos
Version history
Last update:
‎04-21-2026 12:57 AM
Updated by: