amorynan commented on code in PR #31828:
URL: https://github.com/apache/doris/pull/31828#discussion_r1519136953


##########
be/src/vec/functions/function_collection_in.h:
##########
@@ -155,18 +157,25 @@ class FunctionStructIn : public IFunction {
 
         const ColumnWithTypeAndName& left_arg = 
block.get_by_position(arguments[0]);
         const auto& [materialized_column, col_const] = 
unpack_if_const(left_arg.column);
+        auto materialized_column_not_null = materialized_column;
+        if (materialized_column_not_null->is_nullable()) {
+            materialized_column_not_null = assert_cast<ColumnPtr>(
+                    
vectorized::check_and_get_column<vectorized::ColumnNullable>(
+                            materialized_column_not_null)
+                            ->get_nested_column_ptr());
+        }
 
         for (size_t i = 0; i < input_rows_count; ++i) {
-            bool find = args_set.find({materialized_column, i}) != 
args_set.end();
+            bool find = args_set.find({materialized_column_not_null, i}) != 
args_set.end();
+
             if constexpr (negative) {
                 vec_res[i] = !find;
             } else {
                 vec_res[i] = find;
             }
-            if (in_state->null_in_set) {
-                vec_null_map_to[i] = negative == vec_res[i];
-            } else {
-                vec_null_map_to[i] = false;
+
+            if (!find && null_in_set) {

Review Comment:
   do  not make if not have else as possible as u can ! make code clear for 
read . and as less as condition in if , the compiler can make more optimize 
behavior. 



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