mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
fix arrayMap with array of tuples with single argument
This commit is contained in:
parent
99677f3d1a
commit
84aa97b738
@ -135,7 +135,7 @@ public:
|
||||
|
||||
size_t num_function_arguments = function_type->getArgumentTypes().size();
|
||||
if (is_single_array_argument
|
||||
&& tuple_argument_size
|
||||
&& tuple_argument_size > 1
|
||||
&& tuple_argument_size == num_function_arguments)
|
||||
{
|
||||
assert(nested_types.size() == 1);
|
||||
@ -337,12 +337,13 @@ public:
|
||||
}
|
||||
|
||||
const auto * column_tuple = checkAndGetColumn<ColumnTuple>(&column_array->getData());
|
||||
if (is_single_array_argument && column_tuple && column_tuple->getColumns().size() == num_function_arguments)
|
||||
size_t tuple_size = column_tuple ? column_tuple->getColumns().size() : 0;
|
||||
|
||||
if (is_single_array_argument && tuple_size > 1 && tuple_size == num_function_arguments)
|
||||
{
|
||||
const auto & type_tuple = assert_cast<const DataTypeTuple &>(*array_type->getNestedType());
|
||||
const auto & tuple_names = type_tuple.getElementNames();
|
||||
|
||||
size_t tuple_size = column_tuple->getColumns().size();
|
||||
arrays.reserve(column_tuple->getColumns().size());
|
||||
for (size_t j = 0; j < tuple_size; ++j)
|
||||
{
|
||||
|
@ -0,0 +1,4 @@
|
||||
[(1)]
|
||||
[1]
|
||||
[3]
|
||||
[3]
|
@ -0,0 +1,4 @@
|
||||
SELECT arrayMap((x) -> x, [tuple(1)]);
|
||||
SELECT arrayMap((x) -> x.1, [tuple(1)]);
|
||||
SELECT arrayMap((x) -> x.1 + x.2, [tuple(1, 2)]);
|
||||
SELECT arrayMap((x, y) -> x + y, [tuple(1, 2)]);
|
Loading…
Reference in New Issue
Block a user