Presto Java has property preSortedPrefix set by the optimizer to indicate which group of partition + sort keys are already presorted in the window input. This can be used to optimize the sorting in Prestissimo Window operator.
Velox window operator already has an inputsSorted_ field that uses a WindowBuild which skips sorting as an optimization when the preSortedPrefix is the full set of partition by + order by fields. This can be easily used as a first optimization.
Subsequent optimizations to use presortedKeys (which are a subset of the partition keys + order by keys) as an optimization in the global sort in SortWindowBuild can be done as well.
Presto Java has property preSortedPrefix set by the optimizer to indicate which group of partition + sort keys are already presorted in the window input. This can be used to optimize the sorting in Prestissimo Window operator.
Velox window operator already has an inputsSorted_ field that uses a WindowBuild which skips sorting as an optimization when the preSortedPrefix is the full set of partition by + order by fields. This can be easily used as a first optimization.
Subsequent optimizations to use presortedKeys (which are a subset of the partition keys + order by keys) as an optimization in the global sort in SortWindowBuild can be done as well.
@amitkdutta