-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
lexsort, lexsort_to_indices, lexicographical_partition_ranges, etc... make use of LexicographicalComparator to compare rows. The branching and dynamic dispatch involved in this comparator is relatively expensive. Converting to the row format first, and comparing these rows has been found to offer significant performance advantages in similar applications - apache/datafusion#3386.
Describe the solution you'd like
We should provide examples, and potentially some utilities if necessary, to use the row format for these use-cases instead. We can then deprecate the lexicographic kernels and eventually remove them
Describe alternatives you've considered
We could leverage the row format within the existing kernels, however, this has a few drawbacks:
- The additional memory consumption is not necessarily obvious
- When chaining operators together, e.g. sort then partition, the row format conversion will be performed twice
- It isn't obvious how process data in batches
Additional context