ClickHouse/tests/queries/0_stateless/02559_nested_multiple_levels_default.reference
Azat Khuzhin 151ba92a2e Fix reading of non existing nested columns with multiple level in compact parts
Consider the following example:

    CREATE TABLE data (root.array_str Array(UInt8)) ENGINE = MergeTree() ORDER BY tuple();
    INSERT INTO data VALUES ([]);
    ALTER TABLE data ADD COLUMN root.nested_array Array(Array(UInt8));

In this case the first part will not have data for root.nested_array,
and thanks to #37152 it will simply read offsets column from
root.array_str, however since root.nested_array is a nested array, it
will try to read elements from the same offsets stream and if you are
lucky enough you will get one of the following errors:

- Cannot read all data. Bytes read: 1. Bytes expected: 8.: (while reading column root.nested_array): While executing MergeTreeInOrder. (CANNOT_READ_ALL_DATA)
- DB::Exception: Array size is too large: 8233460228287709730: (while reading column serp.serp_features): While executing MergeTreeInOrder.

So to address this, findColumnForOffsets() had been changed to return
the level of the column too, to allow to read only up to this level.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-08 10:21:40 +01:00

7 lines
72 B
Plaintext

data_compact Compact
[[]]
data_memory InMemory
[[]]
data_wide Wide
[[]]