MCPcopy Create free account
hub / github.com/apache/impala / compute_stats_table

Function compute_stats_table

tests/util/compute_table_stats.py:38–53  ·  view source on GitHub ↗

Runs 'compute stats' on a given table. If continue_on_error is True, exceptions computing statistics are swallowed.

(client_factory, db, table)

Source from the content-addressed store, hash-verified

36
37
38def 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
56def log_completion(completed, total_tables, error=None):

Callers

nothing calls this directly

Calls 3

client_factoryFunction · 0.85
executeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected