Snowflake Connector for Python

Поділитися
Вставка
  • Опубліковано 10 лют 2025
  • You can get all snowflake Videos, PPTs, Queries, Interview questions and Practice files in my Udemy course for very less price.. I will be updating this content and will be uploading all new videos in this course.
    My Snowflake Udemy Course:
    www.udemy.com/...
    I can be reachable on jana.snowflake2@gmail.com.
    ====================================
    Step 1: Install Anaconda3 for Python from google
    Step 2: Install Snowflake connector for Python, run below command from cmd prompt
    pip install snowflake-connector-python==3.0.0
    Step 3: Import that connector in your python program
    Step 4: Use snowflake.connector.connect to connect to your snowflake account.
    ===============================
    #!/usr/bin/env python
    import snowflake.connector
    import pandas as pd
    import csv
    from variables import *
    sfconn = snowflake.connector.connect(
    user=username, #user='your-username'
    password=password, #password='your-password'
    account='bb20395.ap-southeast-1' # your account id
    )
    sf = sfconn.cursor()
    sf.execute("SELECT TABLE_SCHEMA, TABLE_NAME, ROW_COUNT from practice_data.INFORMATION_SCHEMA.TABLES WHERE TABLE_CATALOG='PRACTICE_DATA' and TABLE_TYPE='BASE TABLE';")
    counts = sf.fetchall()
    print(counts)
    df=pd.DataFrame(counts)
    print(df)
    with open('C:/Users/janar/OneDrive/Desktop/table_counts.csv', 'w', newline='') as file:
    writer = csv.writer(file, delimiter='|')
    writer.writerows(counts)
    sf.close()
    =========================
    SELECT TABLE_NAME, ROW_COUNT from practice_data.INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='TPCH_SF10' and TABLE_TYPE='BASE TABLE';
    SELECT TABLE_SCHEMA, TABLE_NAME, ROW_COUNT from practice_data.INFORMATION_SCHEMA.TABLES WHERE TABLE_CATALOG='PRACTICE_DATA' and TABLE_TYPE='BASE TABLE';

КОМЕНТАРІ •

  • @kishoreevani5813
    @kishoreevani5813 Рік тому +1

    Thank you for the clear explanation.

  • @sunilkumarreddyd479
    @sunilkumarreddyd479 Рік тому +1

    Thank you, janardhan !

  • @adianalytics4566
    @adianalytics4566 Рік тому +1

    thanks bro

  • @asmitjais3776
    @asmitjais3776 Рік тому

    Hi Janrdan..that helped...can we have other examples like any transformation kind of thing we can do using pandas for snowflake? I mean what else we can do with python connector what we cant do using snowflake

    • @mrjana520
      @mrjana520  Рік тому +1

      Will do in future, now using python worksheet you can write code in snowflake directly, most of the pandas dataframe available in snowpark dataframes

  • @MounikaPathuri-q6g
    @MounikaPathuri-q6g 6 місяців тому

    How to export columnnames of that table into csv file.

    • @mrjana520
      @mrjana520  6 місяців тому

      I don't understand, please explain your requirement clearly.

  • @shehbaazpathan7463
    @shehbaazpathan7463 Рік тому

    Can we download more than 100mb data from snowflake using this connector?

  • @mohammedvahid5099
    @mohammedvahid5099 Рік тому

    Please ఆన్న python use చేసి snowflake coding ఎలా చెయ్యాలో చెప్పండి ఇంకా మరిన్ని videos ఆన్న please

    • @mrjana520
      @mrjana520  Рік тому +1

      I am also trying to learn the same :)

  • @thatinag3646
    @thatinag3646 8 місяців тому

    This video not there in udemy.plz adf