Disable finish sort with sorted chunks

This commit is contained in:
Igor Nikonov 2022-07-14 21:02:44 +00:00
parent 7cd12393c2
commit 1efdb4e3e5
2 changed files with 12 additions and 11 deletions

View File

@ -3,6 +3,7 @@
#include <IO/Operators.h>
#include <Common/JSONBuilder.h>
#include <Common/SipHash.h>
#if USE_EMBEDDED_COMPILER
#include <DataTypes/Native.h>
#include <Interpreters/JIT/compileFunction.h>

View File

@ -274,17 +274,17 @@ void SortingStep::transformPipeline(QueryPipelineBuilder & pipeline, const Build
if (input_sort_mode == DataStream::SortMode::Chunk)
{
if (result_description.hasPrefix(input_sort_desc))
{
LOG_DEBUG(getLogger(), "FinishSorting, SortMode::Chunk");
bool need_finish_sorting = (input_sort_desc.size() < result_description.size());
mergingSorted(pipeline, input_sort_desc, (need_finish_sorting ? 0 : limit));
if (need_finish_sorting)
{
finishSorting(pipeline, input_sort_desc);
}
return;
}
// if (result_description.hasPrefix(input_sort_desc))
// {
// LOG_DEBUG(getLogger(), "FinishSorting, SortMode::Chunk");
// bool need_finish_sorting = (input_sort_desc.size() < result_description.size());
// mergingSorted(pipeline, input_sort_desc, (need_finish_sorting ? 0 : limit));
// if (need_finish_sorting)
// {
// finishSorting(pipeline, input_sort_desc);
// }
// return;
// }
/// almost full sort but chunks are already sorted, so skipping partial sort
if (input_sort_desc.hasPrefix(result_description))