jacktengg commented on code in PR #25859:
URL: https://github.com/apache/doris/pull/25859#discussion_r1371071522


##########
be/src/vec/functions/least_greast.cpp:
##########
@@ -174,6 +174,12 @@ struct FunctionFieldImpl {
         auto& res_data = static_cast<ColumnInt32*>(result_column)->get_data();
 
         const auto& column_size = arguments.size();
+        for (int i = 1; i < column_size; ++i) {
+            block.replace_by_position(
+                    arguments[i],
+                    
ColumnConst::create(block.get_by_position(arguments[i]).column, 1));
+        }

Review Comment:
   For the `field` funcition, it uses `FunctionMultiSameArgs`, for which 
`use_default_implementation_for_constants ` already returns `true`.
   
   The problems is, in function 
`PreparedFunctionImpl::default_implementation_for_constant_arguments`, it 
unpacks the const arguments of `field` function, so we need to pack it back to 
`ConstColumn` here to simplify the modification.



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