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


##########
be/src/vec/functions/function_string.h:
##########
@@ -124,19 +124,15 @@ struct SubstringUtil {
         DCHECK_EQ(arguments.size(), 3);
         auto null_map = ColumnUInt8::create(input_rows_count, 0);
 
-        ColumnPtr argument_columns[3];
-
-        for (int i = 0; i < 3; ++i) {
-            argument_columns[i] =
-                    
block.get_by_position(arguments[i]).column->convert_to_full_column_if_const();
-            if (auto* nullable = 
check_and_get_column<ColumnNullable>(*argument_columns[i])) {
-                // Danger: Here must dispose the null map data first! Because
-                // argument_columns[i]=nullable->get_nested_column_ptr(); will 
release the mem
-                // of column nullable mem of null map
-                VectorizedUtils::update_null_map(null_map->get_data(),
-                                                 
nullable->get_null_map_data());
-                argument_columns[i] = nullable->get_nested_column_ptr();
-            }
+        const auto& col0 = block.get_by_position(arguments[0]).column;
+        bool col_const[3] = {is_column_const(*col0)};
+        ColumnPtr argument_columns[3] = {col_const[0] ? 
col0->convert_to_full_column_if_const()

Review Comment:
   should use `static_cast`, will fix in next commit.



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

Reply via email to