github-actions[bot] commented on code in PR #63391:
URL: https://github.com/apache/doris/pull/63391#discussion_r3302126249
##########
be/src/exprs/function/function.cpp:
##########
@@ -405,4 +405,55 @@ bool
FunctionBuilderImpl::is_nested_type_date_or_datetime_or_decimal(
}
}
+Status IFunctionBase::mock_const_execute(FunctionContext* context, Block&
block,
+ const ColumnNumbers& arguments,
uint32_t result,
+ size_t input_rows_count) const {
+ if (!is_udf_function()) {
+ try {
+ Block const_block;
+ for (size_t col = 0; col < block.columns(); ++col) {
+ auto& col_data = block.get_by_position(col);
+ if (col_data.column) {
+ auto one_row = col_data.column->cut(0, 1);
+ auto const_col = ColumnConst::create(std::move(one_row),
input_rows_count);
+ const_block.insert({std::move(const_col), col_data.type,
col_data.name});
+ } else {
+ const_block.insert(col_data);
+ }
+ }
+ RETURN_IF_ERROR(
Review Comment:
This does not actually exercise many const-column shapes the PR is intended
to catch. By converting every argument to `ColumnConst`, most
`PreparedFunctionImpl` functions enter
`default_implementation_for_constant_arguments()`, which unwraps all
non-`get_arguments_that_are_always_constant()` arguments before calling
`execute_impl`. A real query such as `f(non_const_col, const_literal)` can
still reach `execute_impl` with a mixed `ColumnVector`/`ColumnConst` block, but
this mock turns it into an all-const one-row call and executes with ordinary
nested columns instead. That means the debug check can pass while the target
class of mixed const-input bugs remains uncovered. Please preserve at least one
non-const argument shape, or run targeted constification per argument, so the
check validates the execution paths it is meant to protect.
--
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]