Files
Neo-ZQYY/docs/audit/changes/2026-02-14__drop-dwd-settle-list.md

30 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 审计记录:删除 DWD 层 dwd_settlement_head_ex.settle_list 冗余列
## 溯源
- 日期2026-02-14Asia/Shanghai
- Prompt-IDP20260214-040000
- Prompt 原文文件保存触发database/migrations/20260214_drop_dwd_settle_list.sql— 删除 DWD 层 settle_list 列的迁移脚本
## 直接原因
`settle_list` JSONB 列存储结算明细 JSON与 ODS 层 `payload` 中的 `settleList` 对象完全重复。ODS 层 `settlelist` 列已在同日迁移中删除DWD 层该列同步清理。DWD 加载映射已移除对该列的写入。
## Changed
| 文件/对象 | 变更类型 | 说明 |
|-----------|----------|------|
| `database/migrations/20260214_drop_dwd_settle_list.sql` | 新增 | 迁移脚本DROP COLUMN settle_list |
| `billiards_dwd.dwd_settlement_head_ex` | DDL | 删除 `settle_list` JSONB 列31→30 列) |
| `tasks/dwd/dwd_load_task.py` | 已修改 | FACT_MAPPINGS 中 `dwd_settlement_head_ex``settle_list` 映射已移除 |
| `docs/bd_manual/DWD/20260214_drop_dwd_settle_list.md` | 新增 | BD 手册 DWD 层变更记录 |
## Risk / Verify
- 风险:若 DWD 加载映射未移除 `settle_list`,装载时将报列不存在错误 → 已确认映射已移除
- 风险:若有下游查询直接引用 `dwd_settlement_head_ex.settle_list`,将报错 → DWS 层不消费该列
- 验证:`information_schema.columns` 确认 `settle_list` 列不存在
- 验证DWD 表列数 = 30
- 验证ODS `payload->'settleList'` 仍可按需提取
- 回滚:`ALTER TABLE ... ADD COLUMN settle_list JSONB` + 从 ODS payload 回填