CREATE MATERIALIZED VIEW prodenv.C2C_CAN_MV TO prodenv.C2C_CAN_FILTERED
(
`id` String,
`date` Date,
`timestamp` DateTime64(3),
`sequence` UInt32,
`byte1` UInt8,
`byte2` UInt8,
`byte3` UInt8,
`byte4` UInt8,
`byte5` UInt8,
`byte6` UInt8,
`byte7` UInt8,
`byte8` UInt8,
`can_id` UInt32,
`dbc_ver` UInt16,
`insert_timestamp` DateTime64(3)
)
AS SELECT
id,
toDate(timestamp) AS date,
timestamp,
sequence,
byte1,
byte2,
byte3,
byte4,
byte5,
byte6,
byte7,
byte8,
can_id,
dbc_ver,
insert_timestamp
FROM prodenv.C2C_CAN
WHERE (toDate(timestamp) >= '2025-03-01') AND (id IN ('22', '29'))