<s> from airflow import DAG <EOL> from airflow . operators import DummyOperator , PythonOperator , BranchPythonOperator <EOL> from airflow . contrib . operators import QuboleOperator <EOL> from datetime import datetime , timedelta <EOL> import filecmp <EOL> import random <EOL> seven_days_ago = datetime . combine ( datetime . today ( ) - timedelta ( <NUM_LIT:7> ) , <EOL> datetime . min . time ( ) ) <EOL> default_args = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : seven_days_ago , <EOL> '<STR_LIT:email>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False <EOL> } <EOL> dag = DAG ( '<STR_LIT>' , default_args = default_args ) <EOL> def compare_result ( ds , ** kwargs ) : <EOL> ti = kwargs [ '<STR_LIT>' ] <EOL> r1 = t1 . get_results ( ti ) <EOL> r2 = t2 . get_results ( ti ) <EOL> return filecmp . cmp ( r1 , r2 ) <EOL> t1 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = '<STR_LIT>' , <EOL> query = '<STR_LIT>' , <EOL> cluster_label = '<STR_LIT:default>' , <EOL> fetch_logs = True , <EOL> tags = '<STR_LIT>' , <EOL> dag = dag ) <EOL> t2 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = "<STR_LIT>" , <EOL> script_location = "<STR_LIT>" , <EOL> notfiy = True , <EOL> tags = '<STR_LIT>' , <EOL> trigger_rule = "<STR_LIT>" , <EOL> dag = dag ) <EOL> t3 = PythonOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> provide_context = True , <EOL> python_callable = compare_result , <EOL> trigger_rule = "<STR_LIT>" , <EOL> dag = dag ) <EOL> t3 . set_upstream ( t1 ) <EOL> t3 . set_upstream ( t2 ) <EOL> options = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> branching = BranchPythonOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> python_callable = lambda : random . choice ( options ) , <EOL> dag = dag ) <EOL> branching . set_upstream ( t3 ) <EOL> join = DummyOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> trigger_rule = '<STR_LIT>' , <EOL> dag = dag <EOL> ) <EOL> t4 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = '<STR_LIT>' , <EOL> sub_command = '<STR_LIT>' , <EOL> cluster_label = '<STR_LIT:default>' , <EOL> fetch_logs = True , <EOL> dag = dag ) <EOL> t5 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = "<STR_LIT>" , <EOL> script_location = "<STR_LIT>" , <EOL> parameters = "<STR_LIT>" , <EOL> trigger_rule = "<STR_LIT>" , <EOL> dag = dag ) <EOL> t4 . set_upstream ( branching ) <EOL> t5 . set_upstream ( t4 ) <EOL> t5 . set_downstream ( join ) <EOL> t6 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = '<STR_LIT>' , <EOL> query = '<STR_LIT>' , <EOL> dag = dag ) <EOL> t7 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = "<STR_LIT>" , <EOL> script_location = "<STR_LIT>" , <EOL> parameters = "<STR_LIT>" , <EOL> trigger_rule = "<STR_LIT>" , <EOL> dag = dag ) <EOL> t6 . set_upstream ( branching ) <EOL> t7 . set_upstream ( t6 ) <EOL> t7 . set_downstream ( join ) <EOL> t8 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = '<STR_LIT>' , <EOL> query = '<STR_LIT>' , <EOL> db_tap_id = <NUM_LIT> , <EOL> dag = dag ) <EOL> t9 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = '<STR_LIT>' , <EOL> mode = <NUM_LIT:1> , <EOL> hive_table = '<STR_LIT>' , <EOL> db_table = '<STR_LIT>' , <EOL> partition_spec = '<STR_LIT>' , <EOL> dbtap_id = <NUM_LIT> , <EOL> trigger_rule = "<STR_LIT>" , <EOL> dag = dag ) <EOL> t8 . set_upstream ( branching ) <EOL> t9 . set_upstream ( t8 ) <EOL> t9 . set_downstream ( join ) <EOL> t10 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = '<STR_LIT>' , <EOL> mode = <NUM_LIT:1> , <EOL> hive_table = '<STR_LIT>' , <EOL> db_table = '<STR_LIT>' , <EOL> where_clause = '<STR_LIT>' , <EOL> db_parallelism = <NUM_LIT:2> , <EOL> dbtap_id = <NUM_LIT> , <EOL> trigger_rule = "<STR_LIT>" , <EOL> dag = dag ) <EOL> prog = '''<STR_LIT>''' <EOL> t11 = QuboleOperator ( <EOL> task_id = '<STR_LIT>' , <EOL> command_type = "<STR_LIT>" , <EOL> program = prog , <EOL> language = '<STR_LIT>' , <EOL> arguments = '<STR_LIT>' , <EOL> tags = '<STR_LIT>' , <EOL> dag = dag ) <EOL> t11 . set_upstream ( branching ) <EOL> t11 . set_downstream ( t10 ) <EOL> t10 . set_downstream ( join ) </s>
