Fix partial insert handling for null measurements#17879
Open
Caideyipi wants to merge 5 commits into
Open
Conversation
jt2594838
reviewed
Jun 9, 2026
jt2594838
left a comment
Contributor
There was a problem hiding this comment.
Use a unified entry point to make null-related judgments instead of scattering them around.
Comment on lines
69
to
84
| public static long getRowRecordSize(List<TSDataType> dataTypes, Object[] value) { | ||
| int emptyRecordCount = 0; | ||
| return getRowRecordSize(dataTypes, value, null); | ||
| } | ||
|
|
||
| public static long getRowRecordSize( | ||
| List<TSDataType> dataTypes, Object[] value, TsTableColumnCategory[] columnCategories) { | ||
| int dataTypeIndex = 0; | ||
| long memSize = 0L; | ||
| for (int i = 0; i < value.length; i++) { | ||
| if (value[i] == null) { | ||
| emptyRecordCount++; | ||
| if (value[i] == null || !isFieldColumn(columnCategories, i)) { | ||
| continue; | ||
| } | ||
| memSize += getRecordSize(dataTypes.get(i - emptyRecordCount), value[i], false); | ||
| memSize += getRecordSize(dataTypes.get(dataTypeIndex++), value[i], false); | ||
| } | ||
| return memSize; | ||
| } |
Contributor
There was a problem hiding this comment.
dataTypes is null-free?
If you enforce some restrictions on it now, you should add some comment to mention it.
Collaborator
Author
There was a problem hiding this comment.
Done. Added comments in MemUtils clarifying that dataTypes contains only non-null FIELD types and is ordered with the non-null FIELD values.
jt2594838
approved these changes
Jun 10, 2026
|
jt2594838
approved these changes
Jun 10, 2026
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.



Summary:
Tests: