V20261022_01__ai_clean_row_stats.sql 1.6 KB

1234567891011121314151617181920212223242526
  1. -- ============================================================================
  2. -- ops 迁移版本:V20261022_01
  3. -- 源脚本:sql/ai_clean_row_stats.sql
  4. -- 说明:由 deploy/ops/db.sh 按版本顺序执行;已执行过的文件请勿再修改。
  5. -- ============================================================================
  6. -- ============================================================================
  7. -- ai_clean_job / ai_clean_batch:行级失败与成功/失败统计(2026-10-22)
  8. --
  9. -- 新增:
  10. -- job.row_rejected 必填空值/类型错误/函数异常/超长导致整行拒绝的行数
  11. -- job.row_warned 已入库但含非必填错误的行数(单元格置空)
  12. -- job.row_unprocessed 失败任务里未处理到的行数
  13. -- batch.loaded_rows / rejected_rows / unprocessed_rows / self_built_count
  14. --
  15. -- 本脚本用于**已存在的** AI 元数据表;新环境直接按 ai_clean.sql 建表即可。
  16. -- 全部语句幂等,可重复执行。
  17. -- ============================================================================
  18. alter table ai_clean_job add column if not exists row_rejected integer;
  19. alter table ai_clean_job add column if not exists row_warned integer;
  20. alter table ai_clean_job add column if not exists row_unprocessed integer;
  21. alter table ai_clean_batch add column if not exists loaded_rows bigint default 0;
  22. alter table ai_clean_batch add column if not exists rejected_rows bigint default 0;
  23. alter table ai_clean_batch add column if not exists unprocessed_rows bigint default 0;
  24. alter table ai_clean_batch add column if not exists self_built_count integer default 0;