Skip to content

Commit 3abf208

Browse files
committed
more hash test cases
1 parent 99ad357 commit 3abf208

File tree

1 file changed

+37
-0
lines changed
  • x-pack/plugin/esql/qa/testFixtures/src/main/resources

1 file changed

+37
-0
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/hash.csv-spec

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,40 @@ Connected to 10.1.0.2 | 8f8f1cb60832d153f5b9ec6dc828b93f | b0db24720f15857091b3c
1313
Connected to 10.1.0.3 | 912b6dc13503165a15de43304bb77c78 | 75b0480188db8acc4d5cc666a51227eb2bc5b989cd8ca912609f33e0846eff57
1414
Disconnected | ef70e46fd3bbc21e3e1f0b6815e750c0 | 04dfac3671b494ad53fcd152f7a14511bfb35747278aad8ce254a0d6e4ba4718
1515
;
16+
17+
18+
hashOfConvertedType
19+
required_capability: hash_function
20+
21+
FROM sample_data
22+
| WHERE message != "Connection error"
23+
| EVAL input = event_duration::STRING, md5 = hash("md5", input), sha256 = hash("sha256", input)
24+
| KEEP message, input, md5, sha256;
25+
ignoreOrder:true
26+
27+
message:keyword | input:keyword | md5:keyword | sha256:keyword
28+
Connected to 10.1.0.1 | 1756467 | c4fc1c57ee9b1d2b2023b70c8c167b54 | 8376a50a7ba7e6bd1bf9ad0c32d27d2f49fd0fa422573f98f239e21048b078f3
29+
Connected to 10.1.0.2 | 2764889 | 8e8cf005e11a7b5df1d9478a4715a444 | 1031f2bef8eaecbf47319505422300b27ea1f7c38b6717d41332325062f9a56a
30+
Connected to 10.1.0.3 | 3450233 | 09f2c64f5a55e9edf8ffbad336b561d8 | f77d7545769c4ecc85092f4f0b7ec8c20f467e4beb15fe67ca29f9aa8e9a6900
31+
Disconnected | 1232382 | 6beac1485638d51e13c2c53990a2f611 | 9a03c1274a3ebb6c1cb85d170ce0a6fdb9d2232724e06b9f5e7cb9274af3cad6
32+
;
33+
34+
35+
hashOfNullInput
36+
required_capability: hash_function
37+
38+
ROW input=null::STRING | EVAL md5 = hash("md5", input), sha256 = hash("sha256", input);
39+
40+
input:keyword | md5:keyword | sha256:keyword
41+
null | null | null
42+
;
43+
44+
45+
hashWithNullAlgorithm
46+
required_capability: hash_function
47+
48+
ROW input="input" | EVAL hash = hash(null, input);
49+
50+
input:keyword | hash:keyword
51+
input | null
52+
;

0 commit comments

Comments
 (0)