ai_clean_row_stats.sql 1.3 KB

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