示例#1
0
    def __init__(self,
                 hql,
                 hive_conn_id=conf.get('hooks', 'HIVE_DEFAULT_CONN_ID'),
                 *args,
                 **kwargs):
        super(HiveOperator, self).__init__(*args, **kwargs)

        self.hive_conn_id = hive_conn_id
        self.hook = HiveHook(hive_conn_id=hive_conn_id)
        self.hql = hql
示例#2
0
 def __init__(
         self,
         table, partition="ds='{{ ds }}'",
         hive_conn_id=conf.get('hooks', 'HIVE_DEFAULT_CONN_ID'),
         schema='default',
         *args, **kwargs):
     super(HivePartitionSensor, self).__init__(*args, **kwargs)
     if '.' in table:
         schema, table = table.split('.')
     self.hive_conn_id = hive_conn_id
     self.hook = HiveHook(hive_conn_id=hive_conn_id)
     self.table = table
     self.partition = partition
     self.schema = schema