Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport #37978 to 22.4: Fix reading of sparse columns from s3
- Loading branch information
Showing
3 changed files
with
82 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Sparse | ||
50787 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
-- Tags: no-parallel, no-fasttest, no-s3-storage | ||
|
||
DROP TABLE IF EXISTS t_sparse_s3; | ||
|
||
CREATE TABLE t_sparse_s3 (id UInt32, cond UInt8, s String) | ||
engine = MergeTree ORDER BY id | ||
settings ratio_of_defaults_for_sparse_serialization = 0.01, storage_policy = 's3_cache', | ||
min_bytes_for_wide_part = 0, min_compress_block_size = 1; | ||
|
||
INSERT INTO t_sparse_s3 SELECT 1, number % 2, '' FROM numbers(8192); | ||
INSERT INTO t_sparse_s3 SELECT 2, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 3, number % 2, '' FROM numbers(8192); | ||
INSERT INTO t_sparse_s3 SELECT 4, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 5, number % 2, '' FROM numbers(8192); | ||
INSERT INTO t_sparse_s3 SELECT 6, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 7, number % 2, '' FROM numbers(8192); | ||
INSERT INTO t_sparse_s3 SELECT 8, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 9, number % 2, '' FROM numbers(8192); | ||
INSERT INTO t_sparse_s3 SELECT 10, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 11, number % 2, '' FROM numbers(8000); | ||
INSERT INTO t_sparse_s3 SELECT 12, number % 2, 'foo' FROM numbers(192); | ||
INSERT INTO t_sparse_s3 SELECT 13, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 14, number % 2, 'foo' FROM numbers(8192); | ||
INSERT INTO t_sparse_s3 SELECT 15, number % 2, '' FROM numbers(24576); | ||
INSERT INTO t_sparse_s3 SELECT 16, number % 2, 'foo' FROM numbers(4730); | ||
INSERT INTO t_sparse_s3 SELECT 17, number % 2, 'foo' FROM numbers(3462); | ||
INSERT INTO t_sparse_s3 SELECT 18, number % 2, '' FROM numbers(24576); | ||
|
||
OPTIMIZE TABLE t_sparse_s3 FINAL; | ||
|
||
SELECT serialization_kind FROM system.parts_columns | ||
WHERE table = 't_sparse_s3' AND active AND column = 's' | ||
AND database = currentDatabase(); | ||
|
||
SET max_threads = 1; | ||
|
||
SELECT count() FROM t_sparse_s3 | ||
PREWHERE cond | ||
WHERE id IN (1, 3, 5, 7, 9, 11, 13, 15, 17) | ||
AND NOT ignore(s); | ||
|
||
DROP TABLE t_sparse_s3; |