HappenLee commented on code in PR #40769:
URL: https://github.com/apache/doris/pull/40769#discussion_r1757139943


##########
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() {

Review Comment:
   use default param to do `restore_update_flag()` the work. more eazy



-- 
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

Reply via email to