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
fix(sink): promote the physical column type when a contract widens
Symptom: batch 5 of billing_transactions died with
_duckdb.ConversionException: Conversion Error: Type INT64 with value
2216450393 can't be cast because the value is out of range for the
destination type INT32 when casting from source column account_id
The classifier had already returned widening_safe for account_id, the BACKWARD
policy said EVOLVE, and contract v3 on disk said BIGINT. The load still failed.
Root cause: contract evolution and physical table evolution were two separate
things. LandingZone.evolve_table only issued ADD COLUMN for fields missing from
the table, so ddl.build_alter_type had no callers at all. The registry said
BIGINT while DuckDB still said INTEGER, which made the framework's central
promise ("widening is safe, we handle it") false at the storage layer.
Fix: evolve_table now reads the physical types out of information_schema, maps
them back into the logical lattice with duckdb_type_to_spec, and issues
ALTER COLUMN ... SET DATA TYPE for any field whose contract type is a strict
widening of what the table has. The promotion is gated on is_widening so this
path can never narrow a column and truncate landed history.
0 commit comments