For queries of the following type:
the limit 100 from the outer order by can be pushed down to the analytic sort that is done below the AnalyticEval operator. The reason is there are effectively 2 limits:
PARTITION BY l_partkey ORDER BY l_quantity LIMIT PER PARTITION 100
ORDER BY l_partkey .... LIMIT 100
and together they imply
ORDER BY l_partkey, l_quantity LIMIT 100
For the limit pushdown to work, the partition-by exprs must be a leading prefix of the order-by exprs. Also, other qualifying conditions must be met based on the above pattern.