https://pastila.nl/?00ad187f/ecfb3d92d2e879533cc3aea0536ab3d7

22.3 Exception on client:
Code: 49. DB::Exception: offsets_column has data inconsistent with nested_column: data for INSERT was parsed from query. (LOGICAL_ERROR)

22.7 the insert hangs

21.8.4 Received exception from server (version 21.8.4): Code: 62. DB::Exception: Received from localhost:9000. DB::Exception: Empty query.


{
    size_t size = getOffsets().size();
    if (size != filt.size())
        throw Exception(ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH, "Size of filter ({}) doesn't match size of column ({})", filt.size(), size);
    if (size == 0)
        return ColumnArray::create(data);
    Filter nested_filt(getOffsets().back());
    for (size_t i = 0; i < size; ++i)
    {
        if (filt[i])
            memset(&nested_filt[offsetAt(i)], 1, sizeAt(i));
        else
            memset(&nested_filt[offsetAt(i)], 0, sizeAt(i));
    }
    auto res = ColumnArray::create(data->cloneEmpty());
    ssize_t nested_result_size_hint = 0;
    if (result_size_hint < 0)
        nested_result_size_hint = result_size_hint;
    else if (result_size_hint && result_size_hint < 1000000000 && data->size() < 1000000000)    
         nested_result_size_hint = result_size_hint * data->size() / size;
    res->data = data->filter(nested_filt, nested_result_size_hint);
    Offsets & res_offsets = res->getOffsets();
    if (result_size_hint)