This is actually an issue with trait propagation for Filters. TPCH 18 is doing 2 grouped aggregations. The first grouped aggregation (a hash aggregate) has a HAVING predicate and the filter operator seems to incorrectly produce an output collation trait, so there's no sort enforcer added before the second grouped aggregation (a streaming aggregate).
Here's a simple example to reproduce the same issue. Note that no sort is getting added after the filter even though the input is not sorted and there's an order-by requirement.
explain plan for select n_nationkey from cp.`tpch/nation.parquet` group by n_nationkey having n_nationkey < 5 order by n_nationkey");
00-02 Filter(condition=[<($0, 5)])
00-05 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=/tpch/nation.parquet]], selectionRoot=/tpch/nation.parquet, columns=[SchemaPath [`n_nationkey`]]]])
I am in the process of testing a fix for this.