VIOLET V1a: dolphin_violet DDL set + statement-wise applier (applied + verified)
14 tables consolidated from the LIVE post-ALTER dolphin_pink schema (maras_tp + provenance folded into base CREATEs — a fresh DB never replays ALTER chains) + violet_feed_divergence (scan-vs-venue divergence metric, session_id + plane seqs + mono_ns). apply_violet_ddl.py posts ONE statement per HTTP request (multi-statement posts fail — proven on pink 08), is idempotent (all IF NOT EXISTS, double-apply tested live), and verifies the expected table set. Applied to live CH: verify all 14 present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
22
prod/clickhouse/violet/05_anomaly_events.sql
Normal file
22
prod/clickhouse/violet/05_anomaly_events.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- dolphin_violet DDL — consolidated from the LIVE dolphin_pink schema
|
||||
-- (post-ALTER: includes maras_tp + provenance columns). Generated 2026-06-12.
|
||||
-- Apply via apply_violet_ddl.py (one statement per HTTP POST).
|
||||
|
||||
CREATE TABLE IF NOT EXISTS dolphin_violet.anomaly_events
|
||||
(
|
||||
`ts` DateTime64(6, 'UTC'),
|
||||
`ts_day` Date MATERIALIZED toDate(ts),
|
||||
`decision_id` String,
|
||||
`trade_id` String,
|
||||
`symbol` LowCardinality(String),
|
||||
`anomaly` LowCardinality(String),
|
||||
`origin` LowCardinality(String),
|
||||
`sensor` LowCardinality(String) DEFAULT '',
|
||||
`detail` String DEFAULT '',
|
||||
`rm_meta` Float32 DEFAULT 0
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
PARTITION BY toYYYYMM(ts)
|
||||
ORDER BY (ts_day, trade_id, anomaly, ts)
|
||||
TTL ts_day + toIntervalDay(180)
|
||||
SETTINGS index_granularity = 8192;
|
||||
Reference in New Issue
Block a user