Runs 'compute stats' on a given table. If continue_on_error is True, exceptions computing statistics are swallowed.
(client_factory, db, table)
| 36 | |
| 37 | |
| 38 | def compute_stats_table(client_factory, db, table): |
| 39 | """ |
| 40 | Runs 'compute stats' on a given table. If continue_on_error is |
| 41 | True, exceptions computing statistics are swallowed. |
| 42 | """ |
| 43 | with client_factory() as impala_client: |
| 44 | db_table = "%s.%s" % (db, table) |
| 45 | statement = "compute stats %s" % (db_table,) |
| 46 | LOG.info('Executing: %s', statement) |
| 47 | try: |
| 48 | result = impala_client.execute(statement) |
| 49 | LOG.info(" %s -> %s", db_table, ' '.join(result.data).strip()) |
| 50 | return db_table |
| 51 | except Exception as e: |
| 52 | LOG.exception(' Failed on table %s', db_table) |
| 53 | raise e |
| 54 | |
| 55 | |
| 56 | def log_completion(completed, total_tables, error=None): |
nothing calls this directly
no test coverage detected