Skip to content

Commit

Permalink
Merge pull request #60 from airbnb/stdout
Browse files Browse the repository at this point in the history
Making HiveCliHook.run_cli return stdout
  • Loading branch information
mistercrunch committed Jun 22, 2015
2 parents 65c5f0a + c00dafe commit 30ea72c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions airflow/hooks/hive_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ def run_cli(self, hql, schema=None):
cwd=tmp_dir)
all_err = ''
self.sp = sp
stdout = ""
for line in iter(sp.stdout.readline, ''):
stdout += line
logging.info(line.strip())
sp.wait()

if sp.returncode:
raise AirflowException(all_err)

return stdout

def load_file(
self,
filepath,
Expand Down

0 comments on commit 30ea72c

Please sign in to comment.