Skip to content

Commit

Permalink
additional cases
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Dec 13, 2024
1 parent 08eaee6 commit bfab16b
Showing 1 changed file with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ Disconnected | 1232382 | 6beac1485638d51e13c2c53990a2f611 | 9a03c
;


hashOfEmptyInput
required_capability: hash_function

ROW input="" | EVAL md5 = hash("md5", input), sha256 = hash("sha256", input);

input:keyword | md5:keyword | sha256:keyword
| d41d8cd98f00b204e9800998ecf8427e | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
;

hashOfNullInput
required_capability: hash_function

Expand All @@ -50,3 +59,47 @@ ROW input="input" | EVAL hash = hash(null, input);
input:keyword | hash:keyword
input | null
;


hashWithMv
required_capability: hash_function

ROW input=["foo", "bar"] | mv_expand input | EVAL md5 = hash("md5", input), sha256 = hash("sha256", input);

input:keyword | md5:keyword | sha256:keyword
foo | acbd18db4cc2f85cedef654fccc4a4d8 | 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
bar | 37b51d194a7513e45b56f6524f2d51f2 | fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
;


hashWithNestedFunctions
required_capability: hash_function

ROW input=["foo", "bar"] | EVAL hash = concat(hash("md5", mv_concat(input, "-")), "-", hash("sha256", mv_concat(input, "-")));

input:keyword | hash:keyword
["foo", "bar"] | e5f9ec048d1dbe19c70f720e002f9cb1-7d89c4f517e3bd4b5e8e76687937005b602ea00c5cba3e25ef1fc6575a55103e
;


hashWithConvertedTypes
required_capability: hash_function

ROW input=42 | EVAL md5 = hash("md5", input::STRING), sha256 = hash("sha256", to_string(input));

input:integer | md5:keyword | sha256:keyword
42 | a1d0c6e83f027327d8461063f4ac58a6 | 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049
;


hashWithStats
required_capability: hash_function

FROM sample_data
| EVAL md5="md5"
| STATS count = count(*) by hash(md5, message)
| WHERE count > 1;

count:long | hash(md5, message):keyword
3 | 2e92ae79ff32b37fee4368a594792183
;

0 comments on commit bfab16b

Please sign in to comment.