ClickHouse/tests
Azat Khuzhin dee27fcbb9 Fix on-disk format breakage for secondary indices over Nullable column
[1] breaks on disk format (and the relevant change in the:

  [1]: https://github.com/ClickHouse/ClickHouse/pull/12455#discussion_r682830812

Too bad that I checked this patchset only for compatibility after
reverting this patch [2] (use case: I've applied it manually, then
revert it, and data skipping indexes over Nullable column had been
broken)

  [2]: https://github.com/ClickHouse/ClickHouse/pull/12455#issuecomment-823423772

But this patchset actually breaks compatibility with older versions of
clickhouse for Nullable data skipping indexes after simple upgrade:

Here is a simple reproducer:

    --
    -- run this with 21.6 or similar (i.e. w/o this patch)
    --

    CREATE TABLE data
    (
        `key` Int,
        `value` Nullable(Int),
        INDEX value_index value TYPE minmax GRANULARITY 1
    )
    ENGINE = MergeTree
    ORDER BY key;

    INSERT INTO data SELECT
        number,
        number
    FROM numbers(10000);

    SELECT * FROM data WHERE value = 20000 SETTINGS force_data_skipping_indices = 'value_index' SETTINGS force_data_skipping_indices = 'value_index', max_rows_to_read=1;

Now upgrade and run the query again:

    SELECT * FROM data WHERE value = 20000 SETTINGS force_data_skipping_indices = 'value_index' SETTINGS force_data_skipping_indices = 'value_index', max_rows_to_read=1;

And it will fail because of on disk format changes:

    $ ll --time-style=+ data/*/data/all_1_1_0/skp*.idx
    -rw-r----- 1 azat azat 36  data/with_nullable_patch/data/all_1_1_0/skp_idx_value_index.idx
    -rw-r----- 1 azat azat 37  data/without_nullable_patch/data/all_1_1_0/skp_idx_value_index.idx

    $ md5sum data/*/data/all_1_1_0/skp*.idx
    a19c95c4a14506c65665a1e30ab404bf  data/with_nullable_patch/data/all_1_1_0/skp_idx_value_index.idx
    e50e2fcfa873b232196623d56ab26105  data/without_nullable_patch/data/all_1_1_0/skp_idx_value_index.idx

Note, that there is no stable release with this patch included yet, so
no need to backport.

Also note that you may create data skipping indexes over Nullable
column even before [3].

  [3]: https://github.com/ClickHouse/ClickHouse/pull/12455

v2: break cases when granulas has Null in values due to backward
compatibility
2021-08-05 00:19:38 +03:00
..
ci
config Merge pull request #26978 from Algunenano/improve_executable_dictionary 2021-08-02 12:54:08 +03:00
external_models/catboost
fuzz [clickhouse][server][dll][alter]support fetch part 2021-04-13 12:40:33 +08:00
instructions
integration Cover data skipping indices on disk format (compare with 21.6) 2021-08-05 00:19:32 +03:00
jepsen.clickhouse-keeper
perf_drafts
performance Specialize date time comparision. 2021-08-03 16:49:39 +08:00
queries Fix on-disk format breakage for secondary indices over Nullable column 2021-08-05 00:19:38 +03:00
testflows Moving to TestFlows 1.7.20 that has native support for parallel tests. 2021-07-31 15:50:27 -04:00
users.d
.gitignore Support jijna templates for sql files in clickhouse-test 2021-07-20 16:40:04 +03:00
clickhouse-client.xml
clickhouse-test Normalize hostname in CI 2021-08-03 15:00:57 +08:00
client-test.xml done 2020-12-22 18:19:58 +03:00
CMakeLists.txt
decimals_dictionary.xml
executable_pool_dictionary.xml Add missing link for clickhouse-test-server 2021-05-26 16:45:34 +01:00
ints_dictionary.xml
msan_suppressions.txt
server-test.xml Add comments 2021-07-29 09:15:44 +03:00
stress
strings_dictionary.xml
tsan_suppressions.txt
ubsan_suppressions.txt
users.xml