Repository navigation
r2il: bool_or/bool_and keep NULL apart from FALSE; COUNT(DISTINCT) excludes NULL keys (D-RFT-1 correction) - #1686
Conversation
…cludes NULL keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
…try correction Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…correction #1686 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
Item B of the post-merge review of #1681 (
GPT:gpt-ada-01/20261021-pr1674-1682-consolidated-review-01). I took it on the operator's instruction (EXO-50/038). The original owner is session 01G22y, and the operator aligns afterwards.Defects on main
bool_and(TRUE, NULL)answered 0, where PostgreSQL answers TRUE.bool_or(NULL, NULL)answered 0, where PostgreSQL answers NULL.count_distinct_sortedcounted a run of NULL keys by their payload.Change (
crates/lance-graph-r2il/src/procs.rs)bool_orandbool_and. New signature:bool_or(select, valid, flag)/bool_and(select, valid, flag).P = select ∧ valid.present.present == 0is SQL NULL; the value is then 0 and is not FALSE.bool_or = ANY(P ∧ T).bool_and = present − ANY(P ∧ ¬T).count_distinct_sorted. New signature:count_distinct_sorted(key_lane, valid).KEY_RUNS.All three stay R2IL procedures interpreted by
FoldDialectand lowered to existing mask-risc operations. There is no new opcode or terminal, and no crate outside r2il calls these procedures.Evidence
New tests in
tests/procs.rs:bool_aggregates_keep_null_apart_from_falsecovers the directive's six cases, each run again with every NULL payload scrambled:count_distinct_excludes_null_keys_whatever_their_payloadcovers the first, middle and last runs, plus an all-NULL selection.In the existing primitive test, the empty-selection expectation changes from
(0, 1)to NULL.Disable runs. Four, each red on its target test. Each removes
validfrom one place:bool_or;bool_and's FALSE fold;count_distinct_sorted.PostgreSQL 16.15. Run with
examples/null_aggs_pg_parity.rs, a lab instrument that prints SKIP without a server and does not count as CI parity.bool_andTRUE over a NULL row.Gates: r2il tests pass (9 dialect + 22 procs). Clippy
--all-targets -D warningsand fmt are clean.Board: a correction section is appended to
entries/2026-10-21-d-rft-1-typed-composition.md.Merge is attended: I will not merge this PR.
Generated by Claude Code