MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / checkSortedWithPermutation

Function checkSortedWithPermutation

src/Interpreters/sortBlock.cpp:315–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315void 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}

Callers 2

sortBlockFunction · 0.85
stableGetPermutationFunction · 0.85

Calls 5

isCollationRequiredFunction · 0.85
emptyMethod · 0.45
rowsMethod · 0.45

Tested by

no test coverage detected