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
This is one ticket in a series carrying forward #12 foundation work. Read #12 first for repo context.
The fork expanded src/types.rs by ~1,000 LOC and added src/parse_values.rs to unify lenient (read-side) and strict (write-side) parsing of inlined values. Upstream has independently progressed (list/array support in PR datafusion-contrib#89, type alias normalization in datafusion-contrib#82, entity-name validation in datafusion-contrib#81) — so there is partial overlap here that requires careful merging, not blind porting.
Reference branch
ducklake-features/integration:
src/types.rs (+1001 lines vs upstream)
src/parse_values.rs — shared parser, ParseMode::Lenient vs Strict
Tests: inline #[cfg(test)] in parse_values.rs; cross-coverage in tests/cross_engine_*.rs and write tests
Type normalization (case-folding) in is_type_promotion_allowed — R11-S-009 commit
NaN/Inf rejection in compaction delete_threshold range check — R11-S-010 (note: only relevant if compaction comes back later)
parse_decimal_string with checked arithmetic (R11-S-020)
i32::try_from for Date32 num_days to prevent truncation (R11-S-019)
checked_mul for timestamp unit conversions (R11-S-013)
saturating_add for null count accumulation (R11-S-014)
normalize_value limitation: the fork documented a known type-confusion limitation (R11-S-032) — preserve the doc comment so future contributors don't re-discover it.
Acceptance criteria
cargo test passes including the parse_values inline tests and any cross-engine type round-trip tests
Type promotion rules cover all DuckLake-spec-allowed promotions (cross-check the spec table)
Decimal precision/scale round-trips through write → read without loss for at least: DECIMAL(38, 18), DECIMAL(10, 2), DECIMAL(1, 0)
Date32, Timestamp(s/ms/us/ns), and Time roundtrip without overflow
parse_values lenient mode degrades unknown types to UTF-8 (per fork's design); strict mode errors — both behaviors tested
The branch's docs/edge-case-findings.md is worth reading for the type-system gotchas the agent team identified.
The audit-flagged "documented limitation" in normalize_value is genuine and worth keeping — do not silently "fix" it without understanding why it's documented.
Context
This is one ticket in a series carrying forward #12 foundation work. Read #12 first for repo context.
The fork expanded
src/types.rsby ~1,000 LOC and addedsrc/parse_values.rsto unify lenient (read-side) and strict (write-side) parsing of inlined values. Upstream has independently progressed (list/array support in PR datafusion-contrib#89, type alias normalization in datafusion-contrib#82, entity-name validation in datafusion-contrib#81) — so there is partial overlap here that requires careful merging, not blind porting.Reference branch
ducklake-features/integration:src/types.rs(+1001 lines vs upstream)src/parse_values.rs— shared parser,ParseMode::LenientvsStrict#[cfg(test)]inparse_values.rs; cross-coverage intests/cross_engine_*.rsand write testsScope
types.rsagainst the rebased base (post-Foundation: rebase integration onto upstream, drop pass-throughs, triage SLT failures #12). Bucket the changes into:parse_values.rsas-is — it's a clean extraction with no upstream conflict.VARCHAR(N)/CHAR(N)with explicit precision parsingdouble precisionsynonym for DOUBLEvalidate_no_trailing_after_parencheck on parameterized typesis_type_promotion_allowed, used by ALTER TYPE in ALTER/DROP/CREATE schema evolution DDL #20)is_type_promotion_allowed— R11-S-009 commitparse_decimal_stringwith checked arithmetic (R11-S-020)i32::try_fromfor Date32 num_days to prevent truncation (R11-S-019)checked_mulfor timestamp unit conversions (R11-S-013)saturating_addfor null count accumulation (R11-S-014)normalize_valuelimitation: the fork documented a known type-confusion limitation (R11-S-032) — preserve the doc comment so future contributors don't re-discover it.Acceptance criteria
cargo testpasses including theparse_valuesinline tests and any cross-engine type round-trip testsDECIMAL(38, 18),DECIMAL(10, 2),DECIMAL(1, 0)parse_valueslenient mode degrades unknown types to UTF-8 (per fork's design); strict mode errors — both behaviors testedduckdbcrate importsDependencies
is_type_promotion_allowed)Out of scope
parity_basic_crud_after_insertissue) — that's covered in Foundation: rebase integration onto upstream, drop pass-throughs, triage SLT failures #12Notes
docs/edge-case-findings.mdis worth reading for the type-system gotchas the agent team identified.normalize_valueis genuine and worth keeping — do not silently "fix" it without understanding why it's documented.