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


##########
be/src/core/block/column_with_type_and_name.cpp:
##########
@@ -105,41 +105,49 @@ void 
ColumnWithTypeAndName::to_pb_column_meta(PColumnMeta* col_meta) const {
     type->to_pb_column_meta(col_meta);
 }
 
-ColumnWithTypeAndName ColumnWithTypeAndName::unnest_nullable(
-        bool replace_null_data_to_default) const {
-    if (type->is_nullable()) {
-        auto nested_type =
-                assert_cast<const DataTypeNullable*, 
TypeCheckOnRelease::DISABLE>(type.get())
-                        ->get_nested_type();
-        ColumnPtr nested_column = column;
-        if (column) {
-            // A column_ptr is needed here to ensure that the column in 
convert_to_full_column_if_const is not released.
-            auto [column_ptr, is_const] = unpack_if_const(column);
-            const auto* source_column =
-                    assert_cast<const ColumnNullable*, 
TypeCheckOnRelease::DISABLE>(
-                            column_ptr.get());
-            if (is_const) {
-                nested_column =
-                        
ColumnConst::create(source_column->get_nested_column_ptr(), column->size());
-            } else {
-                nested_column = source_column->get_nested_column_ptr();
-            }
-
-            if (replace_null_data_to_default) {
-                const auto& null_map = source_column->get_null_map_data();
-                // only need to mutate nested column, avoid to copy nullmap
-                auto mutable_nested_col = (*std::move(nested_column)).mutate();
-                if (simd::contain_one(null_map.data(), null_map.size())) {
-                    
mutable_nested_col->replace_column_null_data(null_map.data());
-                }
-
-                return {std::move(mutable_nested_col), nested_type, ""};
-            }
-        }
-        return {nested_column, nested_type, ""};
+NullableColumnInfo ColumnWithTypeAndName::get_nullable_column_info() const {
+    DCHECK(type->is_nullable());
+    DCHECK(column);
+
+    // A column_ptr is needed here to ensure that the column in 
convert_to_full_column_if_const is
+    // not released.
+    auto [column_ptr, is_const] = unpack_if_const(column);
+    const auto* source_column =
+            assert_cast<const ColumnNullable*, 
TypeCheckOnRelease::DISABLE>(column_ptr.get());
+    const auto& null_map = source_column->get_null_map_data();
+    const size_t non_null_count =

Review Comment:
   这个函数可不可以考虑后续直接做在nullable的列上啊,而且is_const的时候,这个结果不是错了吗?



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

Reply via email to