cambyzju commented on code in PR #9147: URL: https://github.com/apache/incubator-doris/pull/9147#discussion_r855094379
########## be/src/exprs/table_function/table_function_factory.cpp: ########## @@ -92,14 +85,32 @@ const std::unordered_map<std::pair<std::string, bool>, std::function<TableFuncti {{"explode_json_array_string", true}, VExplodeJsonArrayStringCreator}, {{"explode_bitmap", true}, TableFunctionCreator<vectorized::VExplodeBitmapTableFunction>()}, - {{"explode", true}, VExplodeCreator}, - {{"explode_outer", true}, VExplodeOuterCreator}}; // namespace doris + {{"explode", true}, TableFunctionCreator<vectorized::VExplodeTableFunction> {}}}; + +Status TableFunctionFactory::get_fn(std::string fn_name, bool is_vectorized, ObjectPool* pool, + TableFunction** fn) { + bool is_outer = false; + + auto match_suffix = [](const std::string& name, const std::string& suffix) -> bool { + return name.substr(name.length() - suffix.length()) == suffix; + }; + + auto remove_suffix = [](const std::string& name, const std::string& suffix) -> std::string { + return name.substr(0, name.length() - suffix.length()); + }; + + if (match_suffix(fn_name, suffix_outer)) { + is_outer = true; + fn_name = remove_suffix(fn_name, suffix_outer); + } -Status TableFunctionFactory::get_fn(const std::string& fn_name, bool is_vectorized, Review Comment: use a local variable, such as std::string search_fn_name for search the function. Does it looks better than change argument of get_fn 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