zclllyybb commented on code in PR #63196:
URL: https://github.com/apache/doris/pull/63196#discussion_r3257794460
##########
be/src/exprs/function/function_hash.cpp:
##########
@@ -133,6 +133,107 @@ using FunctionMurmurHash3_64_V2 =
using FunctionMurmurHash3U64V2 =
FunctionVariadicArgumentsBase<DataTypeInt128,
MurmurHash3Impl<TYPE_LARGEINT, true>>;
+struct MurmurHash3128Impl {
+ static constexpr auto name = "murmur_hash3_128";
+
+ static Status empty_apply(IColumn& icolumn, size_t input_rows_count) {
Review Comment:
At least 1 arg? then should return error here
##########
regression-test/suites/query_p0/sql_functions/hash_functions/test_hash_function.groovy:
##########
@@ -100,6 +154,22 @@ suite("test_hash_function", "arrow_flight_sql") {
qt_mmh3_u64_v2_fold_1 "SELECT MURMUR_HASH3_U64_V2('test') + 1;"
qt_mmh3_u64_v2_fold_2 "SELECT MURMUR_HASH3_U64_V2('a', 'b') * 2;"
+ def validate_mmh3_128 = { String expected, String expression ->
Review Comment:
dont use this mode. directly use `qt_sql` and output the result to `.out`
files
##########
regression-test/suites/query_p0/sql_functions/hash_functions/test_hash_function.groovy:
##########
@@ -100,6 +154,22 @@ suite("test_hash_function", "arrow_flight_sql") {
qt_mmh3_u64_v2_fold_1 "SELECT MURMUR_HASH3_U64_V2('test') + 1;"
qt_mmh3_u64_v2_fold_2 "SELECT MURMUR_HASH3_U64_V2('a', 'b') * 2;"
+ def validate_mmh3_128 = { String expected, String expression ->
+ def res = sql "SELECT MURMUR_HASH3_128(${expression});"
+ assertEquals(expected, res[0][0] == null ? null :
res[0][0].toString());
+ }
+
+ validate_mmh3_128(null, "NULL");
Review Comment:
should also test for some more cases, like zero arg, other type inputs, many
nulls and so on
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]