X Tutup
Skip to content

Commit 4182da4

Browse files
committed
updated impala_foreach_table.py
1 parent dcaee72 commit 4182da4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

impala_foreach_table.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,14 @@ def main():
171171
# doesn't support parameterized query quoting from dbapi spec
172172
table_cursor.execute(query)
173173
for result in table_cursor:
174-
row_count = result[0]
175-
print('{db}.{table}\t{row_count}'.format(db=database, table=table, row_count=row_count))
174+
print('{db}.{table}\t{result}'.format(db=database, table=table, \
175+
result='\t'.join([str(_) for _ in result])))
176176
except (impala.error.OperationalError, impala.error.HiveServer2Error) as _:
177177
log.error(_)
178+
#except impala.error.ProgrammingError as _:
179+
# # COMPUTE STATS returns no results
180+
# if not 'Trying to fetch results on an operation with no results' in _:
181+
# raise
178182

179183

180184
if __name__ == '__main__':

0 commit comments

Comments
 (0)
X Tutup