github-actions[bot] commented on code in PR #63491:
URL: https://github.com/apache/doris/pull/63491#discussion_r3296828325
##########
be/src/core/column/column_nullable.h:
##########
@@ -246,7 +253,10 @@ class ColumnNullable final : public COWHelper<IColumn,
ColumnNullable> {
void for_each_subcolumn(ColumnCallback callback) override {
callback(_nested_column);
- callback(_null_map);
+ IColumn::WrappedPtr null_map(static_cast<const
ColumnUInt8::Ptr&>(_null_map));
+ callback(null_map);
Review Comment:
This temporary wrapper makes read-only subcolumn traversal fail for nullable
columns. `IColumn::dump_structure()`, `count_const_column()`,
`column_boolean_check()`, and `null_map_check()` all call `for_each_subcolumn`
with callbacks that only inspect the subcolumn and do not replace it. In those
paths this local `null_map` still aliases `_null_map` after
`callback(null_map)`, so the final `null_map.get()` goes through non-const
`chameleon_ptr::get()` and calls `assert_mutable_ref()` with `use_count() > 1`,
throwing `COW::assert_mutable`. For example, calling `dump_structure()` on a
`ColumnNullable` will now fail just because the traversal copied the null-map
pointer. Please avoid creating an extra owner for the no-replacement case, or
otherwise update `_null_map` only through a path that does not require
exclusive ownership when the callback did not detach/replace the pointer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]