更新数据库文档 20260201-2

This commit is contained in:
Neo
2026-02-01 23:42:18 +08:00
parent 9b2c2c5c78
commit 294c6edbc9
47 changed files with 961 additions and 138 deletions

View File

@@ -189,114 +189,60 @@ class TaskWorker(QThread):
# 解析 DWD 装载统计
if 'tables' in stats:
total_dim_inserted = 0
total_dim_updated = 0
total_fact_inserted = 0
total_fact_updated = 0
dim_tables = [] # ?????
fact_tables = [] # ?????
dim_tables = [] # 维表明细
fact_tables = [] # 事实表明细
for tbl in stats['tables']:
table_name = tbl.get('table', '').replace('billiards_dwd.', '')
mode = tbl.get('mode', '')
processed = int(tbl.get('processed', 0) or 0)
inserted = int(tbl.get('inserted', 0) or 0)
updated = int(tbl.get('updated', 0) or 0)
has_new_counts = ('inserted' in tbl) or ('updated' in tbl)
# ?? _ex ?????????
# 忽略 _ex 扩展表
if table_name.endswith('_ex'):
continue
is_dim = table_name.startswith('dim_') or mode == 'SCD2'
if is_dim:
if has_new_counts:
total_dim_inserted += inserted
total_dim_updated += updated
if inserted or updated:
dim_tables.append(f"{table_name}: +{inserted}, ~{updated}")
elif processed > 0:
total_dim_updated += processed
dim_tables.append(f"{table_name}: {processed}")
else:
if has_new_counts:
total_fact_inserted += inserted
total_fact_updated += updated
if inserted or updated:
fact_tables.append(f"{table_name}: +{inserted}, ~{updated}")
elif processed > 0 or inserted > 0:
total_fact_inserted += inserted
if inserted > 0:
fact_tables.append(f"{table_name}: +{inserted}")
if (total_dim_inserted or total_dim_updated or total_fact_inserted or total_fact_updated):
dwd_stats.append(
f"????: {total_dim_inserted}?, ????: {total_dim_updated}?, "
f"????: {total_fact_inserted}?, ????: {total_fact_updated}?"
f"维表新增: {total_dim_inserted}条, 维表更新: {total_dim_updated}条, "
f"事实表新增: {total_fact_inserted}, 事实表更新: {total_fact_updated}"
)
# ???????
# 维表明细
if dim_tables:
dwd_stats.append(" 维表: " + ", ".join(dim_tables))
dwd_stats.append(" ???: " + ", ".join(dim_tables))
# ???????
# 事实表明细
if fact_tables:
dwd_stats.append(" ???: " + ", ".join(fact_tables))
dwd_stats.append(" 事实表: " + ", ".join(fact_tables))