diff --git a/dbms/src/DataStreams/CollapsingSortedBlockInputStream.cpp b/dbms/src/DataStreams/CollapsingSortedBlockInputStream.cpp index 4722c260621..d077c972548 100644 --- a/dbms/src/DataStreams/CollapsingSortedBlockInputStream.cpp +++ b/dbms/src/DataStreams/CollapsingSortedBlockInputStream.cpp @@ -195,7 +195,7 @@ void CollapsingSortedBlockInputStream::merge(MutableColumns & merged_columns, st } /// Write data for last primary key. - insertRows(merged_columns, current_block_granularity, stop_condition); + insertRows(merged_columns, /*some_granularity*/ 0, stop_condition); finished = true; } diff --git a/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp b/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp index 849f16c1fcb..cb098a60040 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp @@ -132,7 +132,7 @@ Block MergeTreeBaseSelectBlockInputStream::readFromPart() { if (reader->getColumns().empty()) { - std::cerr << "EMPTY COLUMNS\n"; + //std::cerr << "EMPTY COLUMNS\n"; task->range_reader = MergeTreeRangeReader( pre_reader.get(), nullptr, prewhere_info->alias_actions, prewhere_info->prewhere_actions, @@ -141,12 +141,12 @@ Block MergeTreeBaseSelectBlockInputStream::readFromPart() } else { - std::cerr << "MORE INTERESTING COLUMNS\n"; + //std::cerr << "MORE INTERESTING COLUMNS\n"; MergeTreeRangeReader * pre_reader_ptr = nullptr; if (pre_reader != nullptr) { - std::cerr << "SETTING PREREADER\n"; - std::cerr << "PreReader is NULL:" << (pre_reader == nullptr) << std::endl; + //std::cerr << "SETTING PREREADER\n"; + //std::cerr << "PreReader is NULL:" << (pre_reader == nullptr) << std::endl; task->pre_range_reader = MergeTreeRangeReader( pre_reader.get(), nullptr, prewhere_info->alias_actions, prewhere_info->prewhere_actions, @@ -155,7 +155,7 @@ Block MergeTreeBaseSelectBlockInputStream::readFromPart() pre_reader_ptr = &task->pre_range_reader; } - std::cerr << "Reader is NULL:" << (reader == nullptr) << std::endl; + //std::cerr << "Reader is NULL:" << (reader == nullptr) << std::endl; task->range_reader = MergeTreeRangeReader( reader.get(), pre_reader_ptr, nullptr, nullptr, nullptr, &task->ordered_names, true, false, true); diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index eeda18c452c..6b2f4c55b76 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -1479,7 +1479,7 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart( transaction->new_columns.writeText(columns_file); transaction->rename_map["columns.txt.tmp"] = "columns.txt"; } - std::cerr << "ALTER FINISHED\n"; + //std::cerr << "ALTER FINISHED\n"; return transaction; } diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp index 9b5ae02274e..c1e725eb32e 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp @@ -767,7 +767,7 @@ MergeTreeData::MutableDataPartPtr MergeTreeDataMergerMutator::mergePartsToTempor rows_sources_read_buf.seek(0, 0); ColumnGathererStream column_gathered_stream(column_name, column_part_streams, rows_sources_read_buf); - std::cerr << "TOINDEXGRANULARITY MARKS COUNT:" << to.getIndexGranularity().getMarksCount() << std::endl; + //std::cerr << "TOINDEXGRANULARITY MARKS COUNT:" << to.getIndexGranularity().getMarksCount() << std::endl; MergedColumnOnlyOutputStream column_to( data, column_gathered_stream.getHeader(), @@ -878,7 +878,7 @@ MergeTreeData::MutableDataPartPtr MergeTreeDataMergerMutator::mutatePartToTempor new_data_part->is_temp = true; String new_part_tmp_path = new_data_part->getFullPath(); - std::cerr << "NEW TEMP PART:" << new_part_tmp_path << std::endl; + //std::cerr << "NEW TEMP PART:" << new_part_tmp_path << std::endl; /// Note: this is done before creating input streams, because otherwise data.data_parts_mutex /// (which is locked in data.getTotalActiveSizeInBytes()) is locked after part->columns_lock diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp index a7797fda6cc..11730cf0e3c 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp @@ -217,15 +217,15 @@ String MergeTreeDataPart::getColumnNameWithMinumumCompressedSize() const for (const auto & column : storage_columns) { - std::cerr << "Searching for column:" << column.name << std::endl; + //std::cerr << "Searching for column:" << column.name << std::endl; if (!hasColumnFiles(column.name)) { - std::cerr << "No column files:" << column.name << std::endl; + //std::cerr << "No column files:" << column.name << std::endl; continue; } const auto size = getColumnSize(column.name, *column.type).data_compressed; - std::cerr << "Column size:" <data_part->index_granularity.getMarksCount() << std::endl; + //std::cerr << "STREAM IS FINISHED\n"; + //std::cerr << "MAKRSCOUNT:" << merge_tree_reader->data_part->index_granularity.getMarksCount() << std::endl; result.addRows(stream.finalize(result.block)); stream = Stream(ranges.back().begin, ranges.back().end, merge_tree_reader); result.addRange(ranges.back()); diff --git a/dbms/src/Storages/MergeTree/MergeTreeReadPool.cpp b/dbms/src/Storages/MergeTree/MergeTreeReadPool.cpp index cd652ecdc61..6b2e68d8d89 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeReadPool.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeReadPool.cpp @@ -28,7 +28,7 @@ MergeTreeReadPool::MergeTreeReadPool( column_names{column_names}, do_not_steal_tasks{do_not_steal_tasks}, predict_block_size_bytes{preferred_block_size_bytes > 0}, prewhere_info{prewhere_info}, parts_ranges{parts} { - std::cerr << "PARTS SIZE:" << parts.size() << std::endl; + //std::cerr << "PARTS SIZE:" << parts.size() << std::endl; avg_parts_granularity = getAvgGranularityForAllPartsRanges(parts); /// reverse from right-to-left to left-to-right diff --git a/dbms/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputStream.cpp b/dbms/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputStream.cpp index 2a874da1d6d..78b691c9656 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputStream.cpp @@ -30,11 +30,11 @@ MergeTreeThreadSelectBlockInputStream::MergeTreeThreadSelectBlockInputStream( if (max_block_size_rows) { size_t avg_granularity = pool->getAvgGranularityForReadingParts(); - std::cerr << "AVG GRANULARITY:" << avg_granularity << std::endl; + //std::cerr << "AVG GRANULARITY:" << avg_granularity << std::endl; min_marks_to_read = (min_marks_to_read_ * avg_granularity + max_block_size_rows - 1) / max_block_size_rows * max_block_size_rows / avg_granularity; - std::cerr << "MIN MARKS TO READ:" << min_marks_to_read << std::endl; + //std::cerr << "MIN MARKS TO READ:" << min_marks_to_read << std::endl; } else min_marks_to_read = min_marks_to_read_; diff --git a/dbms/src/Storages/MergeTree/checkDataPart.cpp b/dbms/src/Storages/MergeTree/checkDataPart.cpp index 8d21a6b48b2..5184ac0044e 100644 --- a/dbms/src/Storages/MergeTree/checkDataPart.cpp +++ b/dbms/src/Storages/MergeTree/checkDataPart.cpp @@ -345,8 +345,8 @@ MergeTreeData::DataPart::Checksums checkDataPart( }, settings.path); size_t rows_after_mark = adaptive_index_granularity.getMarkRows(mark_num); - std::cerr << "rows after mark:" << rows_after_mark << std::endl; - std::cerr << "mark_num:" << mark_num << std::endl; + //std::cerr << "rows after mark:" << rows_after_mark << std::endl; + //std::cerr << "mark_num:" << mark_num << std::endl; ++mark_num; /// Read index_granularity rows from column. diff --git a/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.reference b/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.reference index cc515509866..a5daa54856d 100644 --- a/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.reference +++ b/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.reference @@ -29,4 +29,3 @@ ----00804---- 2 1 - diff --git a/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.sql b/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.sql index a3163603719..eaececd68e4 100644 --- a/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.sql +++ b/dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_pk.sql @@ -51,6 +51,8 @@ SELECT count() FROM test.merge_tree WHERE toUInt64(x) IN (0, 0); DROP TABLE test.merge_tree; SELECT '----00804----'; +SET max_rows_to_read = 0; +SET force_primary_key = 0; DROP TABLE IF EXISTS test.large_alter_table; DROP TABLE IF EXISTS test.store_of_hash;