Commit be8e5e9
fix: Add BaseVector::reusable() to recursively check vector reusability
Summary:
This change adds a new static method BaseVector::reusable() that recursively checks if a vector and all its nested children are reusable (have use_count == 1).
The existing verifyVectorState() check in nimble FieldReader only verified the top-level vector's use_count, but complex types like ARRAY<ROW<BIGINT, REAL>> can have nested children that are shared across different parent vectors. When prepareForReuse() is called on a vector whose nested children are still referenced elsewhere, it corrupts those shared children by resetting them to size 0.
Adds BaseVector::reusable() which recursively checks use_count for ROW children, ARRAY elements, and MAP keys/values
Updates verifyVectorState() in nimble FieldReader to use the new recursive check
Adds unit tests for the new method
Differential Revision: D937909721 parent 0263aea commit be8e5e9
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | | - | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
0 commit comments