Skip to content

Commit

Permalink
Better cache management
Browse files Browse the repository at this point in the history
  • Loading branch information
Algunenano committed Nov 22, 2022
1 parent ad95846 commit e63ba06
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Processors/Formats/Impl/ValuesBlockInputFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ static bool skipToNextRow(PeekableReadBuffer * buf, size_t min_chunk_bytes, int
/// and it's more efficient if they don't (as everything is already tokenized)
void ValuesBlockInputFormat::readUntilTheEndOfRowAndReTokenize(size_t current_column_idx)
{
if (tokens && token_iterator)
if (tokens && token_iterator &&
/// Make sure the underlying memory hasn't changed because of next() calls in the buffer
(*token_iterator)->begin >= buf->buffer().begin() && (*token_iterator)->begin <= buf->buffer().end())
return;
skipToNextRow(buf.get(), 0, 1);
buf->makeContinuousMemoryFromCheckpointToPos();
Expand Down
Empty file.
24 changes: 24 additions & 0 deletions tests/queries/0_stateless/02482_value_block_assert.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SET allow_suspicious_low_cardinality_types=1;
CREATE TABLE range_key_dictionary_source_table__fuzz_323
(
`key` UInt256,
`start_date` Int8,
`end_date` LowCardinality(UInt256),
`value` Tuple(UInt8, Array(DateTime), Decimal(9, 1), Array(Int16), Array(UInt8)),
`value_nullable` UUID
)
ENGINE = TinyLog;
INSERT INTO range_key_dictionary_source_table__fuzz_323 FORMAT Values
(1, toDate('2019-05-20'), toDate('2019-05-20'), 'First', 'First'); -- { clientError CANNOT_PARSE_INPUT_ASSERTION_FAILED }


CREATE TABLE complex_key_dictionary_source_table__fuzz_267
(
`id` Decimal(38, 30),
`id_key` Array(UUID),
`value` Array(Nullable(DateTime64(3))),
`value_nullable` Nullable(UUID)
)
ENGINE = TinyLog;
INSERT INTO complex_key_dictionary_source_table__fuzz_267 FORMAT Values
(1, 'key', 'First', 'First'); -- { clientError CANNOT_READ_ARRAY_FROM_TEXT }

0 comments on commit e63ba06

Please sign in to comment.