From cb2976491bd9c7e80157ed8cd31ba1ab1a5b3ada Mon Sep 17 00:00:00 2001 From: Lirikl Date: Sat, 13 May 2023 11:43:08 +0300 Subject: [PATCH] fix empty arrays bug --- src/Functions/array/arrayFold.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Functions/array/arrayFold.cpp b/src/Functions/array/arrayFold.cpp index 23160af58b6..e2d36903f36 100644 --- a/src/Functions/array/arrayFold.cpp +++ b/src/Functions/array/arrayFold.cpp @@ -159,8 +159,9 @@ public: std::vector data_arrays; data_arrays.resize(array_count); - for (size_t i = 0; i < array_count; ++i) - data_arrays[i] = arrays[i].column->scatter(max_array_size, selector); + if (max_array_size > 0) + for (size_t i = 0; i < array_count; ++i) + data_arrays[i] = arrays[i].column->scatter(max_array_size, selector); size_t prev_size = rows_count; IColumn::Permutation inverse_permutation(rows_count);