@@ -139,6 +139,12 @@ h2o_big_join: h2oai benchmark with large dataset (1e9 rows) fo
139139h2o_small_window: Extended h2oai benchmark with small dataset (1e7 rows) for window, default file format is csv
140140h2o_medium_window: Extended h2oai benchmark with medium dataset (1e8 rows) for window, default file format is csv
141141h2o_big_window: Extended h2oai benchmark with large dataset (1e9 rows) for window, default file format is csv
142+ h2o_small_window_sorted: Window Top-N over a declared-sorted h2o input, small dataset (1e7 rows), default file format is csv
143+ h2o_medium_window_sorted: Window Top-N over a declared-sorted h2o input, medium dataset (1e8 rows), default file format is csv
144+ h2o_big_window_sorted: Window Top-N over a declared-sorted h2o input, large dataset (1e9 rows), default file format is csv
145+ h2o_small_window_sorted_parquet: Window Top-N over a declared-sorted h2o input, small dataset (1e7 rows), source file format is parquet
146+ h2o_medium_window_sorted_parquet: Window Top-N over a declared-sorted h2o input, medium dataset (1e8 rows), source file format is parquet
147+ h2o_big_window_sorted_parquet: Window Top-N over a declared-sorted h2o input, large dataset (1e9 rows), source file format is parquet
142148h2o_small_parquet: h2oai benchmark with small dataset (1e7 rows) for groupby, file format is parquet
143149h2o_medium_parquet: h2oai benchmark with medium dataset (1e8 rows) for groupby, file format is parquet
144150h2o_big_parquet: h2oai benchmark with large dataset (1e9 rows) for groupby, file format is parquet
@@ -309,6 +315,26 @@ main() {
309315 h2o_big_window)
310316 data_h2o_join " BIG" " CSV"
311317 ;;
318+ # the sorted window subgroup derives its data from the same
319+ # source, then sorts it inside its load SQL
320+ h2o_small_window_sorted)
321+ data_h2o_join " SMALL" " CSV"
322+ ;;
323+ h2o_medium_window_sorted)
324+ data_h2o_join " MEDIUM" " CSV"
325+ ;;
326+ h2o_big_window_sorted)
327+ data_h2o_join " BIG" " CSV"
328+ ;;
329+ h2o_small_window_sorted_parquet)
330+ data_h2o_join " SMALL" " PARQUET"
331+ ;;
332+ h2o_medium_window_sorted_parquet)
333+ data_h2o_join " MEDIUM" " PARQUET"
334+ ;;
335+ h2o_big_window_sorted_parquet)
336+ data_h2o_join " BIG" " PARQUET"
337+ ;;
312338 h2o_small_parquet)
313339 data_h2o " SMALL" " PARQUET"
314340 ;;
@@ -534,6 +560,24 @@ main() {
534560 h2o_big_window)
535561 run_h2o_window " BIG" " CSV" " window"
536562 ;;
563+ h2o_small_window_sorted)
564+ run_h2o_window_sorted " small" " csv"
565+ ;;
566+ h2o_medium_window_sorted)
567+ run_h2o_window_sorted " medium" " csv"
568+ ;;
569+ h2o_big_window_sorted)
570+ run_h2o_window_sorted " big" " csv"
571+ ;;
572+ h2o_small_window_sorted_parquet)
573+ run_h2o_window_sorted " small" " parquet"
574+ ;;
575+ h2o_medium_window_sorted_parquet)
576+ run_h2o_window_sorted " medium" " parquet"
577+ ;;
578+ h2o_big_window_sorted_parquet)
579+ run_h2o_window_sorted " big" " parquet"
580+ ;;
537581 h2o_small_parquet)
538582 run_h2o " SMALL" " PARQUET"
539583 ;;
@@ -1266,6 +1310,38 @@ run_h2o_window() {
12661310 h2o_runner " $1 " " $2 " " window"
12671311}
12681312
1313+ # Runs the h2o window_sorted subgroup: window Top-N over an input that declares
1314+ # the ordering the window requires.
1315+ #
1316+ # The `window` subgroup registers `x` with no declared ordering, so
1317+ # `output_ordering()` is None and any plan that depends on a declared ordering is
1318+ # unreachable from it, however the data happens to sit on disk. This subgroup's
1319+ # load SQL writes a sorted copy and registers it `WITH ORDER`, then asserts a
1320+ # per-partition top-K operator is actually in the plan so a silent fallback to
1321+ # window-plus-filter cannot masquerade as a result.
1322+ #
1323+ # The sort happens in the untimed `load` step, so it stays out of the
1324+ # measurement. Data comes from the same source as the window subgroup, so the
1325+ # data step is data_h2o_join.
1326+ #
1327+ # H2O_FILE_TYPE selects the *source* format and so only affects that untimed
1328+ # load: the measured query always reads the sorted Parquet copy, whatever the
1329+ # source was. A Parquet source still makes the load markedly cheaper than
1330+ # re-parsing a multi-GB CSV, which is why the `_parquet` entries exist; they are
1331+ # expected to produce the same measured numbers as their CSV counterparts, not
1332+ # different ones. Each entry pairs with the data step that generates its format.
1333+ run_h2o_window_sorted () {
1334+ SIZE=${1:- " small" }
1335+ FILE_TYPE=${2:- " csv" }
1336+ echo " Running h2o window_sorted benchmark (size=${SIZE} , source format=${FILE_TYPE} )..."
1337+ debug_run env BENCH_NAME=h2o \
1338+ BENCH_SUBGROUP=window_sorted \
1339+ H2O_BENCH_SIZE=" ${SIZE} " \
1340+ H2O_FILE_TYPE=" ${FILE_TYPE} " \
1341+ ${QUERY: +BENCH_QUERY=" ${QUERY} " } \
1342+ bash -c " $SQL_CARGO_COMMAND "
1343+ }
1344+
12691345# Runs the external aggregation benchmark
12701346run_external_aggr () {
12711347 # Use TPC-H SF1 dataset
0 commit comments