zclllyybb commented on code in PR #17970: URL: https://github.com/apache/doris/pull/17970#discussion_r1147631507
########## be/src/vec/functions/function_string.h: ########## @@ -146,20 +143,25 @@ struct SubstringUtil { assert_cast<const ColumnVector<Int32>*>(argument_columns[1].get()); auto specific_len_column = assert_cast<const ColumnVector<Int32>*>(argument_columns[2].get()); - - vector(specific_str_column->get_chars(), specific_str_column->get_offsets(), - specific_start_column->get_data(), specific_len_column->get_data(), - null_map->get_data(), res->get_chars(), res->get_offsets()); - + if (col_const[1] && col_const[2]) { + vector_scalar_args(specific_str_column->get_chars(), specific_str_column->get_offsets(), + specific_start_column->get_element(0), + specific_len_column->get_element(0), null_map->get_data(), + res->get_chars(), res->get_offsets()); + } else { + vector3(specific_str_column->get_chars(), specific_str_column->get_offsets(), Review Comment: if one of arguments column is const, there's a bug. have to convert such a column. (and check similar usage.) -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org