You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
typelayer: table CHECK constraints are not evaluated at ingest #727
Found while moving the type layer to chtypes 1.0 in draft PR #712 (branch chtypes-v2).
Problem. Table CHECK constraints are not evaluated at ingest.
WaveHouse builds the CREATE TABLE it gives chtypes from discovery's columns (system.columns), so no CONSTRAINT … CHECK reaches chtypes.
A record that violates a table CHECK is accepted, and may be delivered on the stream.
The server then refuses it at INSERT (code 469), and the worker parks it.
This was already the case before #712 (main does not evaluate table CHECKs at ingest either), so it is not a regression.
Evidence.
Measured by a probe of the chtypes 1.0 artifact during feat(typelayer)!: validate, coerce and filter through chtypes #712: chtypes compiles CONSTRAINT … CHECK clauses, and its CHECK verdicts now match the server's. That covers non-UInt8 results refused with code 1, and x > 0 refused with 469, on exactly the rows the server refuses.
Inferred from internal/typelayer/ddl.go, which emits columns only, and internal/discovery (which reads system.columns; system.tables.create_table_query is fetched but not used for this).
Effect. Clients get 202/200 for records that will never be stored. Stream subscribers can see rows that the table refuses.
Found while moving the type layer to chtypes 1.0 in draft PR #712 (branch
chtypes-v2).Problem. Table
CHECKconstraints are not evaluated at ingest.CREATE TABLEit gives chtypes from discovery's columns (system.columns), so noCONSTRAINT … CHECKreaches chtypes.CHECKis accepted, and may be delivered on the stream.INSERT(code 469), and the worker parks it.This was already the case before #712 (
maindoes not evaluate tableCHECKs at ingest either), so it is not a regression.Evidence.
CONSTRAINT … CHECKclauses, and itsCHECKverdicts now match the server's. That covers non-UInt8results refused with code 1, andx > 0refused with 469, on exactly the rows the server refuses.internal/typelayer/ddl.go, which emits columns only, andinternal/discovery(which readssystem.columns;system.tables.create_table_queryis fetched but not used for this).Effect. Clients get
202/200for records that will never be stored. Stream subscribers can see rows that the table refuses.