| 313 | } |
| 314 | |
| 315 | void checkSortedWithPermutation(const Block & block, const SortDescription & description, UInt64 limit, const IColumn::Permutation & permutation) |
| 316 | { |
| 317 | if (block.empty()) |
| 318 | return; |
| 319 | |
| 320 | ColumnsWithSortDescriptions columns_with_sort_desc = getColumnsWithSortDescription(block, description); |
| 321 | bool is_collation_required = false; |
| 322 | |
| 323 | for (auto & column_with_sort_desc : columns_with_sort_desc) |
| 324 | { |
| 325 | if (isCollationRequired(column_with_sort_desc.description)) |
| 326 | { |
| 327 | is_collation_required = true; |
| 328 | break; |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | size_t rows = block.rows(); |
| 333 | |
| 334 | if (is_collation_required) |
| 335 | { |
| 336 | PartialSortingLessWithCollation less(columns_with_sort_desc); |
| 337 | checkSortedWithPermutationImpl(rows, less, limit, permutation); |
| 338 | return; |
| 339 | } |
| 340 | else |
| 341 | { |
| 342 | PartialSortingLess less(columns_with_sort_desc); |
| 343 | checkSortedWithPermutationImpl(rows, less, limit, permutation); |
| 344 | return; |
| 345 | } |
| 346 | } |
| 347 | #endif |
| 348 | |
| 349 | } |
no test coverage detected