File tree 3 files changed +21
-0
lines changed
ydb/library/yql/udfs/common/digest
canondata/test.test_Basic_ 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ namespace {
89
89
return TUnboxedValuePod (hash);
90
90
}
91
91
92
+ SIMPLE_STRICT_UDF (TCityHashWithSeed, ui64(TAutoMap<char *>, ui64)) {
93
+ Y_UNUSED (valueBuilder);
94
+ const auto & inputRef = args[0 ].AsStringRef ();
95
+ ui64 seed = args[1 ].Get <ui64>();
96
+ ui64 hash = CityHash64WithSeed (inputRef.Data (), inputRef.Size (), seed);
97
+ return TUnboxedValuePod (hash);
98
+ }
99
+
92
100
using TUi64Pair = NUdf::TTuple<ui64, ui64>;
93
101
94
102
class TCityHash128 : public TBoxedValue {
@@ -378,6 +386,7 @@ namespace {
378
386
TMurMurHash2A,
379
387
TMurMurHash2A32,
380
388
TCityHash,
389
+ TCityHashWithSeed,
381
390
TCityHash128,
382
391
TNumericHash,
383
392
TMd5Hex,
Original file line number Diff line number Diff line change 70
70
"Uint64"
71
71
]
72
72
];
73
+ [
74
+ "cityWithSeed";
75
+ [
76
+ "DataType";
77
+ "Uint64"
78
+ ]
79
+ ];
73
80
[
74
81
"city128";
75
82
[
268
275
"5654386555365545660";
269
276
"1466639702";
270
277
"11413460447292444913";
278
+ "684814019408231284";
271
279
[
272
280
"125830901799957853";
273
281
"7569582475522398857"
326
334
"16472888669357673283";
327
335
"2351653828";
328
336
"17472595041006102391";
337
+ "8016373356242392939";
329
338
[
330
339
"13426016195983081906";
331
340
"17051066397148972982"
384
393
"6734453432295282525";
385
394
"2128480519";
386
395
"11275350073939794026";
396
+ "1669883546352889947";
387
397
[
388
398
"15168680716710346397";
389
399
"13490672353767795293"
442
452
"0";
443
453
"0";
444
454
"11160318154034397263";
455
+ "12607432989128692740";
445
456
[
446
457
"18085479540095642321";
447
458
"11079402499652051579"
Original file line number Diff line number Diff line change 9
9
Digest::MurMurHash2A(key) AS murmur2a,
10
10
Digest::MurMurHash2A32(key) AS murmur2a32,
11
11
Digest::CityHash(key) AS city,
12
+ Digest::CityHashWithSeed(key, 111 ) AS cityWithSeed,
12
13
Digest::CityHash128(key) AS city128,
13
14
Digest::NumericHash(COALESCE(CAST(key AS Uint64), 0 )) AS numeric ,
14
15
Digest::Md5Hex(key) AS md5hex,
You can’t perform that action at this time.
0 commit comments