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


##########
be/src/vec/columns/column_const.cpp:
##########
@@ -209,4 +211,37 @@ std::pair<ColumnPtr, size_t> 
check_column_const_set_readability(const IColumn& c
     }
     return result;
 }
+
+std::pair<const ColumnPtr&, bool> unpack_if_const(const ColumnPtr& ptr) 
noexcept {
+    if (is_column_const(*ptr)) {
+        return std::make_pair(
+                std::cref(static_cast<const 
ColumnConst&>(*ptr).get_data_column_ptr()), true);
+    }
+    return std::make_pair(std::cref(ptr), false);
+}
+
+void default_preprocess_parameter_columns(ColumnPtr* columns, const bool* 
col_const,
+                                          const std::initializer_list<size_t>& 
parameters,
+                                          Block& block, const ColumnNumbers& 
arg_indexes) noexcept {
+    if (std::all_of(parameters.begin(), parameters.end(),
+                    [&](const size_t& const_index) -> bool { return 
col_const[const_index]; })) {

Review Comment:
   do not use reference to pass the origin type like `int/size_t`



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