SubhamSinghal opened a new pull request, #24732:
URL: https://github.com/apache/datafusion/pull/24732
## Which issue does this PR close?
Related to #6899 — adds benchmark coverage for the WindowTopN operators.
## Rationale for this change
The existing `h2o --subgroup window` Top-N sweep (q13–q29) registers `x`
with no declared ordering, so `output_ordering()` is `None`. Any plan that
depends on the input being sorted is unreachable from those queries, however
the data happens to be laid out on disk. This adds a `window_sorted` subgroup
that publishes the same sweep over a `WITH ORDER` table, so ordering-dependent
plans can be measured.
## What changes are included in this PR?
A `window_sorted` h2o subgroup: 16 queries covering ROW_NUMBER / RANK /
DENSE_RANK × 100 / 1K / 10K / 100K partitions, plus heavy-ties variants.
- Two `load` directives: the existing `load_window_${SIZE}_${FORMAT}.sql`
creates `x`, then a new script writes a sorted copy via `COPY (... ORDER BY pk,
ob DESC)` and registers it `WITH ORDER (pk ASC, ob DESC)`. Reusing the existing
loader keeps both the `--size` and `--format` axes working with no duplication.
`load` is untimed, so the sort stays out of the measurement.
- `WITH ORDER` can only name columns, so the partition key (`id3 % N`) and
the tie expression are materialized as `pk` and `ob`.
- Asserts guard the three ways this could silently measure nothing: both
config flags took effect, the sorted copy holds every source row, and `ob` has
the cardinality the query name claims.
- `expect_plan PartitionedTopKExec` is deliberately the shared substring, so
the same file validates the heap operator and any streaming variant that
replaces it.
No Rust changes; benchmark files only.
## Are these changes tested?
`benchmark_runner h2o --subgroup window_sorted` runs all 16 queries green.
Row counts are exact: 2 per partition for the distinct-ORDER-BY shapes, and
1,010,812 (RANK) / 2,020,722 (DENSE_RANK) for the tie shapes — the top-1 and
top-2 of 10 distinct values over 10M rows.
## Are there any user-facing changes?
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]