mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #36812 from CurtizJ/hash-array-of-tuples
Allow to execute hash functions with arguments of type `Array(Tuple(..))`
This commit is contained in:
commit
0caf91602f
@ -987,7 +987,8 @@ private:
|
||||
const size_t nested_size = nested_column->size();
|
||||
|
||||
typename ColumnVector<ToType>::Container vec_temp(nested_size);
|
||||
executeAny<true>(nested_type, nested_column, vec_temp);
|
||||
bool nested_is_first = true;
|
||||
executeForArgument(nested_type, nested_column, vec_temp, nested_is_first);
|
||||
|
||||
const size_t size = offsets.size();
|
||||
|
||||
@ -1058,8 +1059,7 @@ private:
|
||||
else if (which.isString()) executeString<first>(icolumn, vec_to);
|
||||
else if (which.isFixedString()) executeString<first>(icolumn, vec_to);
|
||||
else if (which.isArray()) executeArray<first>(from_type, icolumn, vec_to);
|
||||
else
|
||||
executeGeneric<first>(icolumn, vec_to);
|
||||
else executeGeneric<first>(icolumn, vec_to);
|
||||
}
|
||||
|
||||
void executeForArgument(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to, bool & is_first) const
|
||||
|
@ -0,0 +1,5 @@
|
||||
14617701568871014978
|
||||
12913842429399915005
|
||||
8351543757058688770
|
||||
12732328028874882204
|
||||
12371801021764949421 Array(Tuple(UInt8, Array(Tuple(UInt8, Tuple(UInt8, UInt8, Array(Tuple(UInt8, UInt8)))))))
|
6
tests/queries/0_stateless/02292_hash_array_tuples.sql
Normal file
6
tests/queries/0_stateless/02292_hash_array_tuples.sql
Normal file
@ -0,0 +1,6 @@
|
||||
SELECT cityHash64([(1, 'a'), (2, 'b')]);
|
||||
SELECT cityHash64([(1, 'c'), (2, 'b')]);
|
||||
SELECT sipHash64([(1, 'a'), (2, 'b')]);
|
||||
SELECT murmurHash2_64([(1, 'a'), (2, 'b'), (3, 'c')]);
|
||||
|
||||
SELECT cityHash64([(1, [(1, (3, 4, [(5, 6), (7, 8)]))]), (2, [])] AS c), toTypeName(c);
|
Loading…
Reference in New Issue
Block a user