forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Backport ClickHouse#37978 to 22.3: Fix reading of sparse columns from s3 * Merge pull request ClickHouse#38239 from CurtizJ/fix-reading-from-s3 Fix reading from s3 in some corner cases Co-authored-by: robot-clickhouse <[email protected]> Co-authored-by: Nikita Taranov <[email protected]> Co-authored-by: Kruglov Pavel <[email protected]>
- Loading branch information
1 parent
2a83062
commit 25886f5
Showing
5 changed files
with
111 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; |
1 change: 1 addition & 0 deletions
1
tests/queries/0_stateless/02343_read_from_s3_compressed_blocks.reference
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 @@ | ||
57344 |
15 changes: 15 additions & 0 deletions
15
tests/queries/0_stateless/02343_read_from_s3_compressed_blocks.sql
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,15 @@ | ||
-- Tags: no-parallel, no-fasttest, no-s3-storage | ||
|
||
DROP TABLE IF EXISTS t_s3_compressed_blocks; | ||
|
||
CREATE TABLE t_s3_compressed_blocks (id UInt64, s String CODEC(NONE)) | ||
ENGINE = MergeTree ORDER BY id | ||
SETTINGS storage_policy = 's3_cache', | ||
min_bytes_for_wide_part = 0; | ||
|
||
INSERT INTO t_s3_compressed_blocks SELECT number, randomPrintableASCII(128) from numbers(57344); | ||
|
||
SET max_threads = 1; | ||
SELECT count() FROM t_s3_compressed_blocks WHERE NOT ignore(s); | ||
|
||
DROP TABLE t_s3_compressed_blocks; |