Repository navigation
[Fix] Remap failed-measurement indices when reordering insert columns - #18819
Merged
JackieTien97 merged 2 commits intoOct 11, 2026
Merged
JackieTien97 merged 2 commits into
JackieTien97 merged 2 commits into
Conversation
JackieTien97
approved these changes
Oct 10, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18819 +/- ##
============================================
- Coverage 45.82% 45.82% -0.01%
Complexity 712 712
============================================
Files 5498 5498
Lines 397637 397661 +24
Branches 51765 51770 +5
============================================
- Hits 182235 182231 -4
- Misses 215402 215430 +28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JackieTien97
deleted the
fix/remap-failed-measurement-index-after-column-reorder
branch
October 11, 2026 06:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
failedMeasurementIndex2Infomaps a column index to the info of a measurement whose value failed partial-insert handling. When the insert columns are later reordered to match the schema's TAG order, this map is not updated:InsertBaseStatement.swapColumn(src, target)swaps the measurement arrays but leaves the map keys untouched.InsertBaseStatement.rebuildArraysAfterExpansion(newToOldMapping, ...)rebuilds the arrays fromnewToOldMappingbut leaves the map keys untouched.The map therefore no longer describes the final
measurementsarray. Any consumer that pairs the map with the arrays by index is then wrong, e.g.:LogicalPlanVisitormarks the failed measurement on theInsertRowNodeby the (stale) index.removeAllFailedMeasurementMarks()restores the wrong column name / data type / value.PipeConverted*Statement) resolves the wrong column (or none).Note that
InsertBaseStatement.removeAttributeColumns()already remapsfailedMeasurementIndex2Infowhen it drops columns, so the missing remap inswapColumn/rebuildArraysAfterExpansionis an inconsistency in the same data structure.Fix
swapColumn(src, target)now swaps the two corresponding entries offailedMeasurementIndex2Info.rebuildArraysAfterExpansion(...)now rewrites the map keys from the old indices to the new ones described bynewToOldMapping(newToOldMapping[newIdx] = oldIdx); entries whose old index is-1(an appended missing TAG column) have no failure record and are naturally skipped.Both are additive, behavior-preserving for the non-reordered case (the map is empty or already aligned).
Tests
Added to
InsertStatementPartialInsertTest:testSwapColumnRemapsFailedMeasurementIndextestRebuildArraysAfterExpansionRemapsFailedMeasurementIndex