Skip to content

Commit

Permalink
Merge branch '1526'
Browse files Browse the repository at this point in the history
  • Loading branch information
aoen committed May 23, 2016
2 parents 8d72975 + a5c00b3 commit ee24855
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/hooks/hive_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ def to_csv(
schema='default',
delimiter=',',
lineterminator='\r\n',
output_header=True):
output_header=True,
fetch_size=1000):
schema = schema or 'default'
with self.get_conn() as conn:
with conn.cursor() as cur:
Expand All @@ -504,7 +505,7 @@ def to_csv(
for c in cur.description])
i = 0
while True:
rows = [row for row in cur.fetchmany() if row]
rows = [row for row in cur.fetchmany(fetch_size) if row]
if not rows:
break

Expand Down

0 comments on commit ee24855

Please sign in to comment.