HappenLee commented on code in PR #33496:
URL: https://github.com/apache/doris/pull/33496#discussion_r1575616536
##########
be/src/vec/utils/util.hpp:
##########
@@ -169,6 +170,63 @@ inline std::string remove_suffix(const std::string& name,
const std::string& suf
return name.substr(0, name.length() - suffix.length());
};
+inline ColumnPtr create_always_true_column(size_t size, bool is_nullable) {
+ auto res_data_column = ColumnUInt8::create(size, 1);
+ if (is_nullable) {
+ auto null_map = ColumnVector<UInt8>::create(size, 0);
+ return ColumnNullable::create(std::move(res_data_column),
std::move(null_map));
+ }
+ return res_data_column;
+}
+
+// change null element to true element
+inline void change_null_to_true(ColumnPtr column, ColumnPtr argument =
nullptr) {
+ if (is_column_const(*column)) {
+ change_null_to_true(assert_cast<const
ColumnConst*>(column.get())->get_data_column_ptr());
+ } else if (column->is_nullable()) {
+ auto* nullable =
+ const_cast<ColumnNullable*>(assert_cast<const
ColumnNullable*>(column.get()));
+ auto* __restrict data =
assert_cast<ColumnUInt8*>(nullable->get_nested_column_ptr().get())
+ ->get_data()
+ .data();
+ auto* __restrict null_map =
const_cast<uint8_t*>(nullable->get_null_map_data().data());
+ for (size_t i = 0; i < column->size(); ++i) {
Review Comment:
call `column->size()` in for loop cause not SIMD, not call the fun in for
loop
--
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]