HappenLee commented on code in PR #64627:
URL: https://github.com/apache/doris/pull/64627#discussion_r3456973032
##########
be/src/exec/common/util.hpp:
##########
@@ -243,29 +243,36 @@ inline ColumnPtr create_always_true_column(size_t size,
bool is_nullable) {
}
// change null element to true element
-inline void change_null_to_true(MutableColumnPtr column, ColumnPtr argument =
nullptr) {
+inline ColumnPtr change_null_to_true(ColumnPtr&& column, const ColumnPtr&
argument = nullptr) {
size_t rows = column->size();
if (is_column_const(*column)) {
- change_null_to_true(
-
assert_cast<ColumnConst*>(column.get())->get_data_column_ptr()->assert_mutable());
- } else if (column->has_null()) {
- auto* nullable = assert_cast<ColumnNullable*>(column.get());
+ auto nested_column = assert_cast<const
ColumnConst*>(column.get())->get_data_column_ptr();
+ auto nested = change_null_to_true(std::move(nested_column));
+ return ColumnConst::create(std::move(nested), rows);
+ }
+
+ auto mutable_column = IColumn::mutate(std::move(column));
+ if (auto* nullable =
check_and_get_column<ColumnNullable>(*mutable_column)) {
auto* __restrict data =
assert_cast<ColumnUInt8*>(nullable->get_nested_column_ptr().get())
->get_data()
.data();
- const NullMap& null_map = nullable->get_null_map_data();
+ NullMap& null_map = nullable->get_null_map_data();
for (size_t i = 0; i < rows; ++i) {
data[i] |= null_map[i];
}
nullable->fill_false_to_nullmap(rows);
- } else if (argument && argument->has_null()) {
+ return mutable_column;
+ }
Review Comment:
这里应该是个else if,统一275返回啊
--
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]