query

Module window_sort

Source
Expand description

A physical plan for window sort(Which is sorting multiple sorted ranges according to input PartitionRange).

Structsยง

  • SortedRunSet ๐Ÿ”’
  • SucRun ๐Ÿ”’
    A struct to represent a successive run in the input iterator
  • TimeRange ๐Ÿ”’
    Left(start) inclusive right(end) exclusive,
  • A complex stream sort execution plan which accepts a list of PartitionRange and merge sort them whenever possible, and emit the sorted result as soon as possible. This sorting plan only accept sort by ts and will not sort by other fields.
  • The core logic of merging sort multiple sorted ranges

Enumsยง

Functionsยง

  • cmp_with_opts ๐Ÿ”’
    Compare with options, note None is considered as NULL here
  • Compute all working ranges and corresponding working sets from given overlap_counts computed from split_overlapping_ranges
  • Find the slice(where start <= data < end and sort by sort_column.options) from the given range
  • find all successive runs in the input iterator
  • get_sorted_runs ๐Ÿ”’
    return a list of non-overlapping (offset, length) which represent sorted runs, and can be used to call [DfRecordBatch::slice] to get sorted runs Returned runs will be as long as possible, and will not overlap with each other
  • Get timestamp from array at offset
  • split batch to sorted runs
  • return a map of non-overlapping ranges and their corresponding index (not PartitionRange.identifier but position in array) in the input PartitionRanges that is in those ranges
  • split_range_by ๐Ÿ”’
    split input range by split_by range to one, two or three parts.