Merge pull request #38361 from ClickHouse/revert-38324-fix-partial-sort

Revert "Fix optimization in PartialSortingTransform (SIGSEGV and possible incorrect result)"
This commit is contained in:
Alexander Tokmakov 2022-06-23 23:01:20 +03:00 committed by GitHub
commit 2c280354d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 14 deletions

View File

@ -71,7 +71,7 @@ bool compareWithThreshold(const ColumnRawPtrs & raw_block_columns, size_t min_bl
size_t raw_block_columns_size = raw_block_columns.size(); size_t raw_block_columns_size = raw_block_columns.size();
for (size_t i = 0; i < raw_block_columns_size; ++i) for (size_t i = 0; i < raw_block_columns_size; ++i)
{ {
int res = sort_description[i].direction * raw_block_columns[i]->compareAt(min_block_index, 0, *threshold_columns[i], sort_description[i].nulls_direction); int res = sort_description[i].direction * raw_block_columns[i]->compareAt(min_block_index, 0, *threshold_columns[0], sort_description[i].nulls_direction);
if (res < 0) if (res < 0)
return true; return true;

View File

@ -1,10 +0,0 @@
0 999999 999999
0 999998 999998
0 999997 999997
0 999996 999996
0 999995 999995
0 999994 999994
0 999993 999993
0 999992 999992
0 999991 999991
0 999990 999990

View File

@ -1,3 +0,0 @@
-- Regression for PartialSortingTransform optimization
-- that requires at least 1500 rows.
select * from (select * from (select 0 a, toNullable(number) b, toString(number) c from numbers(1e6)) order by a desc, b desc, c limit 1500) limit 10;