Code: ---------- import logging import airflow from airflow import DAG from airflow.operators.python_operator import PythonOperator from airflow.contrib.operators.snowflake_operator import SnowflakeOperator from airflow.contrib.hooks.snowflake_hook import SnowflakeHook from datetime import datetime, timedelta logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) args = {"owner": "Airflow", "start_date": airflow.utils.dates.days_ago(2)} dag = DAG( dag_id="snowflake_automation_dag", default_args=args, schedule_interval=None ) snowflake_query = [ """ create table if not exists source_table( emp_no int,emp_name text,salary int, hra int ,Dept text); """, """INSERT INTO source_table VALUES (100, 'A' ,2000, 100,'HR'), (101, 'B' ,5000, 300,'HR'), (102, 'C' ,6000, 400,'Sales'), (103, 'D' ,500, 50,'Sales'), (104, 'E' ,15000, 3000,'Tech'), (105, 'F' ,150000, 20050,'Tech'), (105, 'F' ,150000, 20060,'Tech'); """ ] with dag: create_table = SnowflakeOperator( task_id="create_table", sql=snowflake_query[0] , snowflake_conn_id="snowflake_conn" ) insert_data = SnowflakeOperator( task_id="insert_snowflake_data", sql=snowflake_query[1] , snowflake_conn_id="snowflake_conn" ) create_table >> insert_data
@kaushikgorrepati60158 ай бұрын
Thank you for all your videos, they're really helpful and inspiring us to learn more.🙂
@KnowledgeAmplifier18 ай бұрын
Glad to hear this Kaushik Gorrepati! Happy Learning
@prasannakusugal4333 Жыл бұрын
Thanks for this video and many other videos too, they are really helpful :)
@KnowledgeAmplifier111 ай бұрын
Glad it was helpful!
@roshankumargupta466 ай бұрын
Thanks for your videos. Can you please make a different playlist for snowflake?
@KnowledgeAmplifier16 ай бұрын
You are welcome @roshankumargupta46! Here is the complete snowflake course (all KZfaq videos are available in order) -- doc.clickup.com/37466271/d/h/13qc4z-104/d4346819bd8d510 Happy Learning
@manikumar-vr3kp4 ай бұрын
hey hii pls help me im following the steps excatly as u to creation snowflake connection in airflow but it keeps on fails
@GsureTechnologies7 ай бұрын
From where to get the KeyPair file ? I am new to all this. So pls help. Thanks.