github-actions[bot] commented on code in PR #61846:
URL: https://github.com/apache/doris/pull/61846#discussion_r3007333570
##########
regression-test/suites/query_p0/sql_functions/hash_functions/test_hash_function.groovy:
##########
@@ -32,6 +32,73 @@ suite("test_hash_function", "arrow_flight_sql") {
qt_mmh3_64_v2_2 "SELECT MURMUR_HASH3_64_V2('1000209601_1756808272');"
qt_mmh3_64_v2_3 "SELECT MURMUR_HASH3_64_V2('hello world');"
qt_mmh3_64_v2_4 "SELECT MURMUR_HASH3_64_V2('apache doris');"
+ qt_mmh3_64_v2_5 "SELECT MURMUR_HASH3_64_V2('1013199993_1756808272');"
+ qt_mmh3_64_v2_6 "SELECT MURMUR_HASH3_64_V2('1020273884_1756808272');"
+
+ // murmur_hash3_u64_v2 tests
+ qt_mmh3_u64_v2_1 "SELECT MURMUR_HASH3_U64_V2(NULL);"
+ qt_mmh3_u64_v2_2 "SELECT MURMUR_HASH3_U64_V2('1000209601_1756808272');"
+ qt_mmh3_u64_v2_3 "SELECT MURMUR_HASH3_U64_V2('hello world');"
+ qt_mmh3_u64_v2_4 "SELECT MURMUR_HASH3_U64_V2('apache doris');"
+ qt_mmh3_u64_v2_5 "SELECT MURMUR_HASH3_U64_V2('1013199993_1756808272');"
+ qt_mmh3_u64_v2_6 "SELECT MURMUR_HASH3_U64_V2('1020273884_1756808272');"
+ qt_mmh3_u64_v2_7 "SELECT MURMUR_HASH3_U64_V2('');"
+ qt_mmh3_u64_v2_8 "SELECT MURMUR_HASH3_U64_V2('a');"
+ qt_mmh3_u64_v2_9 "SELECT MURMUR_HASH3_U64_V2('hello', 'world');"
+ qt_mmh3_u64_v2_10 "SELECT MURMUR_HASH3_U64_V2('hello', 'world', '!');"
+
+ // Validation: murmur_hash3_u64_v2 should equal (murmur_hash3_64_v2 &
2^64-1)
+ def validate_mmh3_u64_v2 = { String... args ->
+ def argList = args.collect { "'${it}'" }.join(', ')
+ def u64_res = sql "SELECT MURMUR_HASH3_U64_V2(${argList});"
+ def v2_masked = sql "SELECT CAST(MURMUR_HASH3_64_V2(${argList}) AS
LARGEINT) & 18446744073709551615;"
+ assertEquals(u64_res, v2_masked);
+ }
+
+ validate_mmh3_u64_v2('1000209601_1756808272');
+ validate_mmh3_u64_v2('hello world');
+ validate_mmh3_u64_v2('apache doris');
+ validate_mmh3_u64_v2('1013199993_1756808272');
+ validate_mmh3_u64_v2('1020273884_1756808272');
+ validate_mmh3_u64_v2('');
+ validate_mmh3_u64_v2('a');
+ validate_mmh3_u64_v2('你好🤣');
+ validate_mmh3_u64_v2('アパッチドリス');
+
+ // Table-based tests for mmh3_64_v2 and mmh3_u64_v2
+ sql "DROP TABLE IF EXISTS test_hash_tbl;"
+ sql """
+ CREATE TABLE test_hash_tbl (
+ id INT,
+ str_col VARCHAR(100)
+ ) DUPLICATE KEY(id)
+ DISTRIBUTED BY HASH(id) BUCKETS 1
+ PROPERTIES ("replication_num" = "1");
+ """
+
+ sql """
+ INSERT INTO test_hash_tbl VALUES
+ (1, '1000209601_1756808272'),
+ (2, 'hello world'),
+ (3, NULL),
+ (4, ''),
+ (5, 'apache doris'),
+ (6, '1013199993_1756808272'),
+ (7, '1020273884_1756808272'),
+ (8, '你好🤣'),
+ (9, 'アパッチドリス');
+ """
+
+ qt_mmh3_64_v2_table "SELECT id, MURMUR_HASH3_64_V2(str_col) FROM
test_hash_tbl ORDER BY id;"
+ qt_mmh3_u64_v2_table "SELECT id, MURMUR_HASH3_U64_V2(str_col) FROM
test_hash_tbl ORDER BY id;"
+
+ sql "DROP TABLE IF EXISTS test_hash_tbl;"
Review Comment:
Nit (test standard): Per coding standards, tables should not be dropped
after tests to preserve the environment for debugging. The `DROP TABLE IF
EXISTS test_hash_tbl` at line 69 (before use) is correct and sufficient — this
line should be removed.
From AGENTS.md: "After completing tests, do not drop tables; instead drop
tables before using them in tests, to preserve the environment for debugging."
--
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]