[function](hash) add support of murmur_hash3_64 (#12923)

This commit is contained in:
TengJianPing
2022-09-26 14:23:37 +08:00
committed by GitHub
parent 72220440dc
commit 1bb42a7bc0
13 changed files with 307 additions and 71 deletions

View File

@ -55,6 +55,39 @@ TEST(HashFunctionTest, murmur_hash_3_test) {
};
}
TEST(HashFunctionTest, murmur_hash_3_64_test) {
std::string func_name = "murmur_hash3_64";
{
InputTypeSet input_types = {TypeIndex::String};
DataSet data_set = {{{Null()}, Null()},
{{std::string("hello")}, (int64_t)-3215607508166160593}};
check_function<DataTypeInt64, true>(func_name, input_types, data_set);
};
{
InputTypeSet input_types = {TypeIndex::String, TypeIndex::String};
DataSet data_set = {
{{std::string("hello"), std::string("world")}, (int64_t)3583109472027628045},
{{std::string("hello"), Null()}, Null()}};
check_function<DataTypeInt64, true>(func_name, input_types, data_set);
};
{
InputTypeSet input_types = {TypeIndex::String, TypeIndex::String, TypeIndex::String};
DataSet data_set = {{{std::string("hello"), std::string("world"), std::string("!")},
(int64_t)1887828212617890932},
{{std::string("hello"), std::string("world"), Null()}, Null()}};
check_function<DataTypeInt64, true>(func_name, input_types, data_set);
};
}
TEST(HashFunctionTest, murmur_hash_2_test) {
std::string func_name = "murmurHash2_64";