HappenLee commented on code in PR #14528: URL: https://github.com/apache/doris/pull/14528#discussion_r1031019878
########## be/src/vec/functions/least_greast.cpp: ########## @@ -110,17 +111,96 @@ struct CompareMultiImpl { } }; +struct FunctionFieldImpl { + static constexpr auto name = "field"; + + static DataTypePtr get_return_type_impl(const DataTypes& /*arguments*/) { + return std::make_shared<DataTypeInt32>(); + } + + static ColumnPtr execute(Block& block, const ColumnNumbers& arguments, + size_t input_rows_count) { + const auto& data_type = block.get_by_position(arguments[0]).type; + auto result_column = ColumnInt32::create(input_rows_count, 0); + auto& res_data = static_cast<ColumnInt32*>(result_column)->get_data(); + + const auto& column_size = arguments.size(); + ColumnPtr argument_columns[column_size]; + for (int i = 0; i < column_size; ++i) { + argument_columns[i] = block.get_by_position(arguments[i]).column; + } + argument_columns[0] = argument_columns[0]->convert_to_full_column_if_const(); + WhichDataType which(data_type); + if (which.is_string_or_fixed_string()) { Review Comment: ADD a TODO: hashmap to speed up the function -- 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