HappenLee commented on code in PR #40769: URL: https://github.com/apache/doris/pull/40769#discussion_r1757142519
########## be/src/vec/columns/column_nullable.h: ########## @@ -50,6 +49,62 @@ class ColumnSorter; using NullMap = ColumnUInt8::Container; using ConstNullMapPtr = const NullMap*; +/// use this to avoid directly access null_map forgetting modify _need_update_has_null. see more in inner comments +class NullMapProvider { +public: + NullMapProvider() = default; + NullMapProvider(MutableColumnPtr&& null_map) : _null_map(std::move(null_map)) {} + void reset_null_map(MutableColumnPtr&& null_map) { _null_map = std::move(null_map); } + + // Return the column that represents the byte map. if want use null_map, just call this. + const ColumnPtr& get_null_map_column_ptr() const { return _null_map; } + MutableColumnPtr get_null_map_column_ptr() { + _need_update_has_null = true; + return _null_map->assume_mutable(); + } + IColumn::WrappedPtr& get_null_map() { + _need_update_has_null = true; + return _null_map; + } + + ColumnUInt8& get_null_map_column() { + _need_update_has_null = true; + return assert_cast<ColumnUInt8&, TypeCheckOnRelease::DISABLE>(*_null_map); + } + const ColumnUInt8& get_null_map_column() const { + return assert_cast<const ColumnUInt8&, TypeCheckOnRelease::DISABLE>(*_null_map); + } + + NullMap& get_null_map_data() { return get_null_map_column().get_data(); } + const NullMap& get_null_map_data() const { return get_null_map_column().get_data(); } + + void clear_null_map() { _null_map->clear(); } Review Comment: useless virtual func call -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org