Repository navigation
Revert "Lazily apply selector and replication indexes in join" - #106277
Conversation
|
Workflow [PR], commit [5e42887] Summary: ✅
AI ReviewSummaryThis PR reverts Missing context / blind spots
Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block Minimum required actions: fix the non-dismissed |
| void ColumnReplicated::popBack(size_t n) | ||
| { | ||
| indexes.popBack(n); | ||
| nested_column = indexes.removeUnusedRowsInIndexedData(std::move(nested_column)); |
There was a problem hiding this comment.
popBack now compacts nested_column, but it leaves insertion_cache populated with positions from the pre-compaction layout. Concrete trace: insert from a ColumnReplicated source so insertion_cache[src_id][src_index] = old_nested_pos, then popBack rows that make removeUnusedRowsInIndexedData drop or remap nested rows. A later insertFrom / insertRangeFrom from the same source will hit the stale cache and append the old index without inserting the value; that index can now point past nested_column->size or at a different value. Please clear insertion_cache after compacting here, as filter does, and add a focused test that inserts from the same replicated source, pops enough rows to compact, then inserts from that source again.
| @@ -68,7 +68,6 @@ void FinishSortingTransform::consume(Chunk chunk) | |||
| } | |||
|
|
|||
| removeConstColumns(chunk); | |||
There was a problem hiding this comment.
The ARRAY JOIN repro linked from #106095 can still reach this prefix comparison with a ColumnReplicated sort key. ArrayJoinAction still lazily wraps non-joined useful columns when enable_lazy_columns_replication is true, and the failing query orders by key; after this revert FinishSortingTransform::consume only removes const columns before less compares last_chunk and chunk. If one side is already materialized and the other is still ColumnReplicated, ColumnString::compareAt / ColumnVector::compareAt sees the wrapper and throws the same bad-cast exception reported in the issue. Please materialize the sort-prefix columns here, or disable lazy replication for this path, and add the issue's ARRAY JOIN ... ORDER BY regression test so the linked bug-fix contract is actually covered.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 148/169 (87.57%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
Reverts #98883
Multiple crashes -> #106095
Version info
26.6.1.332