[feature][vectorized] support replace() (#8384)
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
#include "util/url_coding.h"
|
||||
#include "vec/core/field.h"
|
||||
#include "vec/core/types.h"
|
||||
#include "vec/data_types/data_type_string.h"
|
||||
|
||||
namespace doris::vectorized {
|
||||
using namespace ut_type;
|
||||
@ -1000,6 +1001,22 @@ TEST(function_string_test, function_str_to_date_test) {
|
||||
check_function<DataTypeDateTime, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
TEST(function_string_test, function_replace) {
|
||||
std::string func_name = "replace";
|
||||
InputTypeSet input_types = {
|
||||
TypeIndex::String,
|
||||
TypeIndex::String,
|
||||
TypeIndex::String,
|
||||
};
|
||||
DataSet data_set = {{{Null(), VARCHAR("9090"), VARCHAR("")}, {Null()}},
|
||||
{{VARCHAR("http://www.baidu.com:9090"), VARCHAR("9090"), VARCHAR("")},
|
||||
{VARCHAR("http://www.baidu.com:")}},
|
||||
{{VARCHAR("aaaaa"), VARCHAR("a"), VARCHAR("")}, {VARCHAR("")}},
|
||||
{{VARCHAR("aaaaa"), VARCHAR("aa"), VARCHAR("")}, {VARCHAR("a")}},
|
||||
{{VARCHAR("aaaaa"), VARCHAR("aa"), VARCHAR("a")}, {VARCHAR("aaa")}}};
|
||||
check_function<DataTypeString, true>(func_name, input_types, data_set);
|
||||
}
|
||||
|
||||
} // namespace doris::vectorized
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
Reference in New Issue
Block a user