Backport #68848 to 24.8: Fix empty tuple in array

This commit is contained in:
robot-clickhouse 2024-10-16 11:08:37 +00:00
parent d2acaba718
commit 06cc6f313c
3 changed files with 5 additions and 0 deletions

View File

@ -1598,6 +1598,9 @@ ColumnPtr FunctionArrayElement::executeTuple(const ColumnsWithTypeAndName & argu
const auto & tuple_columns = col_nested->getColumns();
size_t tuple_size = tuple_columns.size();
if (tuple_size == 0)
return ColumnTuple::create(input_rows_count);
const DataTypes & tuple_types = typeid_cast<const DataTypeTuple &>(
*typeid_cast<const DataTypeArray &>(*arguments[0].type).getNestedType()).getElements();

View File

@ -0,0 +1 @@
()

View File

@ -0,0 +1 @@
select [()][0];