Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refine spill log #6821

Merged
merged 4 commits into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dbms/src/Core/Spiller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ BlockInputStreams Spiller::restoreBlocks(size_t partition_id, size_t max_stream_
{
RUNTIME_CHECK_MSG(partition_id < partition_num, "{}: partition id {} exceeds partition num {}.", config.spill_id, partition_id, partition_num);
RUNTIME_CHECK_MSG(spill_finished, "{}: restore before the spiller is finished.", config.spill_id);
std::lock_guard partition_lock(spilled_files[partition_id]->spilled_files_mutex);
if (max_stream_size == 0)
max_stream_size = spilled_files[partition_id]->spilled_files.size();
if (is_input_sorted && spilled_files[partition_id]->spilled_files.size() > max_stream_size)
Expand Down Expand Up @@ -149,12 +150,12 @@ BlockInputStreams Spiller::restoreBlocks(size_t partition_id, size_t max_stream_
ret.push_back(std::make_shared<SpilledFilesInputStream>(std::move(file_infos[i]), input_schema, config.file_provider, spill_version));
}
}
LOG_INFO(logger, "Will restore {} rows from {} files of size {:.3f} MiB compressed, {:.3f} MiB uncompressed using {} streams.", details.rows, spilled_files[partition_id]->spilled_files.size(), (details.data_bytes_compressed / 1048576.0), (details.data_bytes_uncompressed / 1048576.0), ret.size());
if (release_spilled_file_on_restore)
{
/// clear the spilled_files so we can safely assume that the element in spilled_files is always not nullptr
spilled_files[partition_id]->spilled_files.clear();
}
LOG_DEBUG(logger, "Will restore {} rows from file of size {:.3f} MiB compressed, {:.3f} MiB uncompressed.", details.rows, (details.data_bytes_compressed / 1048576.0), (details.data_bytes_uncompressed / 1048576.0));
if (ret.empty())
ret.push_back(std::make_shared<NullBlockInputStream>(input_schema));
return ret;
Expand Down