예제 #1
0
파일: core.py 프로젝트: lyft/Airflow
 def test_hive(self):
     hql = """
     USE airflow;
     DROP TABLE IF EXISTS static_babynames_partitioned;
     CREATE TABLE IF NOT EXISTS static_babynames_partitioned (
         state string,
         year string,
         name string,
         gender string,
         num int)
     PARTITIONED BY (ds string);
     INSERT OVERWRITE TABLE static_babynames_partitioned
         PARTITION(ds='{{ ds }}')
     SELECT state, year, name, gender, num FROM static_babynames;
     """
     t = operators.HiveOperator(task_id='basic_hql', hql=hql, dag=self.dag)
     t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, force=True)
예제 #2
0
 def test_beeline(self):
     t = operators.HiveOperator(task_id='beeline_hql',
                                hive_cli_conn_id='beeline_default',
                                hql=self.hql,
                                dag=self.dag)
     t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, force=True)
예제 #3
0
 def test_hive(self):
     t = operators.HiveOperator(task_id='basic_hql',
                                hql=self.hql,
                                dag=self.dag)
     t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, force=True)
예제 #4
0
 def test_hive_dryrun(self):
     t = operators.HiveOperator(task_id='basic_hql',
                                hql=self.hql,
                                dag=self.dag)
     t.dry_run()