未验证 提交 121c5c96 编写于 作者: A alesapin 提交者: GitHub

Merge pull request #20279 from ClickHouse/relax_check_in_data_writer

Relax check in data writer for non adaptive tables
......@@ -140,7 +140,7 @@ void MergeTreeDataPartWriterWide::shiftCurrentMark(const Granules & granules_wri
/// If we didn't finished last granule than we will continue to write it from new block
if (!last_granule.is_complete)
{
if (settings.blocks_are_granules_size)
if (settings.can_use_adaptive_granularity && settings.blocks_are_granules_size)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Incomplete granules are not allowed while blocks are granules size. "
"Mark number {} (rows {}), rows written in last mark {}, rows to write in last mark from block {} (from row {}), total marks currently {}",
last_granule.mark_number, index_granularity.getMarkRows(last_granule.mark_number), rows_written_in_last_mark,
......@@ -506,7 +506,7 @@ void MergeTreeDataPartWriterWide::finishDataSerialization(IMergeTreeDataPart::Ch
WrittenOffsetColumns offset_columns;
if (rows_written_in_last_mark > 0)
{
if (settings.blocks_are_granules_size)
if (settings.can_use_adaptive_granularity && settings.blocks_are_granules_size)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Incomplete granule is not allowed while blocks are granules size even for last granule. "
"Mark number {} (rows {}), rows written for last mark {}, total marks {}",
getCurrentMark(), index_granularity.getMarkRows(getCurrentMark()), rows_written_in_last_mark, index_granularity.getMarksCount());
......
DROP TABLE IF EXISTS old_school_table;
CREATE TABLE old_school_table
(
key UInt64,
value String
)
ENGINE = MergeTree()
ORDER BY key
SETTINGS index_granularity_bytes = 0, enable_mixed_granularity_parts = 0, min_bytes_for_wide_part = 0,
vertical_merge_algorithm_min_rows_to_activate = 1, vertical_merge_algorithm_min_columns_to_activate = 1;
INSERT INTO old_school_table VALUES (1, '1');
INSERT INTO old_school_table VALUES (2, '2');
OPTIMIZE TABLE old_school_table FINAL;
SELECT * FROM old_school_table ORDER BY key;
OPTIMIZE TABLE old_school_table FINAL; -- just to be sure
SELECT * FROM old_school_table ORDER BY key;
ALTER TABLE old_school_table MODIFY SETTING vertical_merge_algorithm_min_rows_to_activate = 10000, vertical_merge_algorithm_min_columns_to_activate = 10000;
OPTIMIZE TABLE old_school_table FINAL; -- and horizontal merge
SELECT * FROM old_school_table ORDER BY key;
DROP TABLE IF EXISTS old_school_table;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册