[optimizer] Upload stats with db prefix on table name
@@ -406,7 +406,7 @@ def upload_table_stats(request):
stats = dict((stat['data_type'], stat['comment']) for stat in full_table_stats['stats'])
table_stats.append({
- 'table_name': path['table'],
+ 'table_name': '%(database)s.%(table)s' % path, # DB Prefix
'num_rows': stats.get('numRows', -1),
'last_modified_time': stats.get('transient_lastDdlTime', -1),
'total_size': stats.get('totalSize', -1),
@@ -423,7 +423,7 @@ def upload_table_stats(request):
col_stats = dict([(key, val) for col_stat in col_stats for key, val in col_stat.iteritems()])
column_stats.append({
- 'table_name': path['table'],
+ 'table_name': '%(database)s.%(table)s' % path, # DB Prefix
'column_name': col,
'data_type': col_stats['data_type'],
"num_distinct": int(col_stats.get('distinct_count')) if col_stats.get('distinct_count') != '' else -1,
