Skip to content

Commit

Permalink
[comment](sort) Add some comments for sort_column (#44024)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel39 authored Nov 18, 2024
1 parent 33726b0 commit 9dd0c3d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions be/src/vec/columns/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,20 @@ class IColumn : public COW<IColumn> {
/// If the only value column can contain is NULL.
virtual bool only_null() const { return false; }

/**
* ColumnSorter is used to sort each columns in a Block. In this sorting pattern, sorting a
* column will produce a list of EqualRange which has the same elements respectively. And for
* next column in this block, we only need to sort rows in those `range`.
*
* Besides, we do not materialize sorted data eagerly. Instead, the intermediate sorting results
* are represendted by permutation and data will be materialized after all of columns are sorted.
*
* @sorter: ColumnSorter is used to do sorting.
* @flags : indicates if current item equals to the previous one.
* @perms : permutation after sorting
* @range : EqualRange which has the same elements respectively.
* @last_column : indicates if this column is the last in this block.
*/
virtual void sort_column(const ColumnSorter* sorter, EqualFlags& flags,
IColumn::Permutation& perms, EqualRange& range,
bool last_column) const;
Expand Down

0 comments on commit 9dd0c3d

Please sign in to comment.