mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
commit
fd4adf27d6
@ -74,8 +74,9 @@ size_t MergeTreeReaderInMemory::readRows(size_t from_mark, bool continue_reading
|
||||
|
||||
auto mutable_column = res_columns[i]->assumeMutable();
|
||||
auto & res_offstes = assert_cast<ColumnArray &>(*mutable_column).getOffsets();
|
||||
size_t start_offset = total_rows_read ? source_offsets[total_rows_read - 1] : 0;
|
||||
for (size_t row = 0; row < rows_to_read; ++row)
|
||||
res_offstes.push_back(source_offsets[total_rows_read + row]);
|
||||
res_offstes.push_back(source_offsets[total_rows_read + row] - start_offset);
|
||||
|
||||
res_columns[i] = std::move(mutable_column);
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
[0]
|
||||
[0,0,0]
|
||||
[0,0,0,0,0]
|
||||
[0,0,0,0,0,0,0]
|
||||
[0,0,0,0,0,0,0,0,0]
|
||||
[0]
|
||||
[0,0,0]
|
||||
[0,0,0,0,0]
|
||||
[0,0,0,0,0,0,0]
|
||||
[0,0,0,0,0,0,0,0,0]
|
||||
[0]
|
||||
[0,0,0]
|
||||
[0,0,0,0,0]
|
||||
[0,0,0,0,0,0,0]
|
||||
[0,0,0,0,0,0,0,0,0]
|
||||
[0]
|
||||
[0,2,4]
|
||||
[0,2,4,6,8]
|
||||
[0,2,4,6,8,10,12]
|
||||
[0,2,4,6,8,10,12,14,16]
|
||||
[0] [0]
|
||||
[0,1,2] [0,2,4]
|
||||
[0,1,2,3,4] [0,2,4,6,8]
|
||||
[0,1,2,3,4,5,6] [0,2,4,6,8,10,12]
|
||||
[0,1,2,3,4,5,6,7,8] [0,2,4,6,8,10,12,14,16]
|
18
tests/queries/0_stateless/01130_in_memory_parts_nested.sql
Normal file
18
tests/queries/0_stateless/01130_in_memory_parts_nested.sql
Normal file
@ -0,0 +1,18 @@
|
||||
-- Test 00576_nested_and_prewhere, but with in-memory parts.
|
||||
DROP TABLE IF EXISTS nested;
|
||||
|
||||
CREATE TABLE nested (x UInt64, filter UInt8, n Nested(a UInt64)) ENGINE = MergeTree ORDER BY x
|
||||
SETTINGS min_rows_for_compact_part = 200000, min_rows_for_wide_part = 300000;
|
||||
|
||||
INSERT INTO nested SELECT number, number % 2, range(number % 10) FROM system.numbers LIMIT 100000;
|
||||
|
||||
ALTER TABLE nested ADD COLUMN n.b Array(UInt64);
|
||||
SELECT DISTINCT n.b FROM nested PREWHERE filter;
|
||||
SELECT DISTINCT n.b FROM nested PREWHERE filter SETTINGS max_block_size = 10;
|
||||
SELECT DISTINCT n.b FROM nested PREWHERE filter SETTINGS max_block_size = 123;
|
||||
|
||||
ALTER TABLE nested ADD COLUMN n.c Array(UInt64) DEFAULT arrayMap(x -> x * 2, n.a);
|
||||
SELECT DISTINCT n.c FROM nested PREWHERE filter;
|
||||
SELECT DISTINCT n.a, n.c FROM nested PREWHERE filter;
|
||||
|
||||
DROP TABLE nested;
|
Loading…
Reference in New Issue
Block a user