acarmisc commented on issue #16564:
URL: https://github.com/apache/airflow/issues/16564#issuecomment-865374643


   Is not a problem because is very simple... I can reproduce with whatever 
wrong SQL, like `SELECT foo from bar` where obviously `bar` table does not 
exist.
   
   The dag perform a JDBCOperator
   
   ```
   from utils.cdh_airflow_utils import *
   
   from airflow import DAG
   
   from airflow.operators.dummy_operator import DummyOperator
   from airflow.providers.jdbc.operators.jdbc import JdbcOperator
   
   
   """
    GLOBAL VARS AND FUNCTIONS
   """
   args = {...}
   
   dag = DAG(dag_id="my_dag",
             description="...",
             max_active_runs=1,
             concurrency=2,
             start_date=datetime(2020, 9, 6),
             schedule_interval=sched_cron,
             catchup=False,
             tags=args['tags'],
             default_args=args)
   
   connId = CONNECTION_ID_HIVE
   scriptPath = SQL_SCRIPT_PATH + SUB_SQL_PATH
   
   start = DummyOperator(task_id="Start", dag=dag)
   
   refresh_TABLE_NAME = JdbcOperator(task_id="refresh_TABLE_NAME",
                                     sql=splitScript(scriptPath + 
'query_from_file.sql'),
                                     jdbc_conn_id=connId,
                                     autocommit=True,
                                     dag=dag)
   
   end = DummyOperator(
       task_id='End',
       dag=dag,
   )
   
   """
   RELATIONSHIPS
   """
   
   start >> refresh_TABLE_NAME >> end
   
   if __name__ == "__main__":
       dag.cli()
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to