-
[OPIK-6781] Fix level enum typo (WARM→WARN) on automation_rule_evaluator_logs (#6962)
发布于
2026-06-04 08:04:18 +00:00 - [OPIK-6781] Fix level enum typo (WARM->WARN) on automation_rule_evaluator_logs
The
levelcolumn ofautomation_rule_evaluator_logswas created (migration
000010, carried into 000017) as Enum8('TRACE'=0,'DEBUG'=1,'INFO'=2,'WARM'=3,
'ERROR'=4) — position 3 is 'WARM', a typo for 'WARN'. The application emits
'WARN' (LogItem.LogLevel.WARN / logback), so every WARN-level log insert into
this table is rejected by ClickHouse.This is the single root cause behind all three error signatures reported in
OPIK-6781:- 691 UNKNOWN_ELEMENT_OF_ENUM ("Unknown element 'WARN', maybe you meant 'WARM'")
- 27 CANNOT_PARSE_INPUT_ASSERTION_FAILED and
- 43 ILLEGAL_TYPE_OF_ARGUMENT (now64 const)
The 27/43 are not a separate "malformed INSERT" bug — they are how ClickHouse's
async-insert / Values parser surfaces the rejected enum value (it wraps each
column in if(isNull(dummy), defaultValueOfTypeName(...), value); the bad 'WARN'
value fails the whole row parse). Reproduced exactly against ClickHouse 25.3.
Fix: forward migration that renames the value-3 label WARM->WARN via
ALTER TABLE ... MODIFY COLUMN. Renaming an enum label while preserving the
numeric value is a metadata-only change (no data rewrite); all existing values
are preserved. Verified at the SQL level (WARN insert fails before, succeeds
after) and via OnlineScoringEngineTest (migration applies cleanly + logs path
works).Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-6781] Renumber migration 000086 -> 000087 (prefix conflict with main)
000086 was taken by 000086_materialize_environment_skip_indexes.sql merged to
main after this branch was cut. Bump to the next free prefix to clear the
migration-prefix-conflict check. No SQL change.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
下载附件