Commit 1241364
AODBcRewriter: fix paste-join children after row reorder/dedup
Paste-joined ("implicit-join") tables — row N of the child matches row
N of the parent — must keep equal row counts and have embedded index
columns remapped when the parent is reordered or deduped.
Two bugs fixed:
1. O2mccollisionlabel was routed through Stage 2 because it carries
fIndexMcCollisions; Stage 2 then sorted and dropped rows whose MC
collision was dedup'd, breaking the 1:1 join with O2collision and
crashing downstream consumers on the misaligned tables.
2. The SOA SLICE_INDEX_COLUMN fIndexSliceBCs[2]/I — present only on
O2ambiguous{track,mfttr,fwdtr}, which Stage 1 does not touch —
was never remapped after BC dedup, so slice endpoints pointed past
the compacted BC table.
Stage 2 now defers paste-join children to the paste-join handler,
which preserves the parent's row order and applies value-wise remaps
for fIndexMcCollisions / fIndexCollisions / fIndexSliceBCs /
fIndexBCs / fIndexBC via the existing ExtraRemap path. bcPerm is
passed as an explicit argument to avoid an unordered_map iteration-
order side effect that broke O2mccalolabel -> O2calo prefix lookup.
kPasteJoins extended to all pairs documented in AnalysisDataModel.h
(adds O2bcflag/O2bc, O2mccalolabel/O2calo, O2trackcov_iu/O2track_iu,
O2trackextra/O2track_iu, O2fwdtrackcov/O2fwdtrack).
AODBcRewriterValidate gains paste-join row-count parity checks and a
generic fIndex* range check (kIndexBranchToTable) that handles scalar,
fixed-size, and VLA branches uniformly. CLAUDE.md updated.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 0ae184a commit 1241364
2 files changed
Lines changed: 543 additions & 55 deletions
0 commit comments