Skip to content

fix(r13): HAVING and IIF onto the one truth rule; dead join builders removed (R13 slice 6b) - #102

Merged
TimelordUK merged 3 commits into
mainfrom
refactor/r13-slice6b-having-iif
Oct 3, 2026
Merged

TimelordUK merged 3 commits into
mainfrom
refactor/r13-slice6b-having-iif

Conversation

@TimelordUK

Copy link
Copy Markdown
Owner

Summary

R13 slice 6, second part.

  • HAVING and IIF read a value's truth with Trilean::from_value (D4). These were the last two of P62's five copies; all five are now one function. Boolean text converts, other text and dates are errors (as in WHERE), NaN is TRUE, and only TRUE keeps a group / takes IIF's second argument.
  • Dead join code deleted: nested_loop_join_inner, nested_loop_join_left, qualify_column_name (264 lines, no callers — rustc had been warning). Done before 6c changes the nested-loop comparator. Parity report byte-identical.
  • Docs: R13 / P62 / P52 updated; R5 reopened as a dead-code workstream — rustc already names ~30 dead items (inventoried by area in the entry); four slices: harvest rustc's list → coverage pass for pub code → pub(crate) → lints in CI.

Behaviour change

IIF('abc', …), IIF(<date>, …) and HAVING <non-boolean text> now raise an error instead of silently picking a branch / keeping the group. IIF('f', …) now takes the false branch.

Checks

  • Parity: 190 → 191 AGREE / 229; contract holds.
  • cargo test integration (508) and lib (842) green.
  • Examples: all FORMAL pass; smoke failures are expander_rewriters (fails on main) and boe_spot_rates (network timeout).

Next

6c P52 NULL join keys (hash + nested loop) → 6d retire RecursiveWhereEvaluator.

🤖 Generated with Claude Code

TimelordUK and others added 3 commits October 3, 2026 12:08
…R13 slice 6)

HAVING's `is_truthy` and IIF's own table were the last two of P62's five
"is this value true?" copies. Both now go through `Trilean::from_value`:
boolean text converts, other text and dates are errors, NaN is TRUE (non-zero),
and only TRUE keeps a group / takes IIF's second argument.

Exactly the 15 pinned matrix entries went FIXED (7 HAVING, 8 IIF). Parity
moved by exactly the two HAVING cases: having_text_flag_as_condition
DIFFER -> AGREE, having_text_not_a_boolean OURS_ONLY -> BOTH_ERR.
190 -> 191 AGREE / 229. FORMAL examples unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ers (R13 slice 6)

`nested_loop_join_inner`, `nested_loop_join_left` and `qualify_column_name`
had no callers - every nested-loop join goes through the `*_multi` builders -
and rustc has been saying so in a warning nobody read. Removed before P52
changes the nested loop's comparator, so the fix only has live paths to
reach. 264 lines; parity report byte-identical.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… workstream

R13: slice 6b done, dead join builders gone; 6c (P52) and 6d remain.
P62: all five truth-table copies now Trilean::from_value; 191 AGREE / 229.
R5: reopened at the user's request - rustc already names ~30 dead items,
inventoried by area; four slices (rustc's list, coverage pass for pub code,
pub(crate), lints in CI). R14 notes its third parser reader is dead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TimelordUK
TimelordUK merged commit 7ab7d96 into main Oct 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant