Skip to content

Apache DataFusion SQL Query Engine

1.4 KB
Raw Blame
echo Loading tpch items sorted: ${BENCH_SORTED:-false}

#
# Sort queries with different characteristics:
# - Sort key with fixed length or variable length (VARCHAR)
# - Sort key with different cardinality
# - Different number of sort keys
# - Different number of payload columns (thin: 1 additional column other
#   than sort keys; wide: all columns except sort keys)
#
# DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for
# scale factor 1.0, cardinality is counted from SF1 dataset)
#
# Key Columns:
# - Column `l_linenumber`, type: `INTEGER`, cardinality: 7
# - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k
# - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M
# - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars)
#
# Payload Columns:
# - Thin variant: `l_partkey` column with `BIGINT` type (1 column)
# - Wide variant: all columns except for possible key columns (12 columns)

name Q11
group sort_tpch
subgroup sf${BENCH_SIZE:-1}

echo Loading sort_tpch sf ${BENCH_SIZE:-1} data

load sql_benchmarks/sort_tpch/init/load.sql

assert I
SELECT COUNT(*) > 0 from lineitem;
----
true

run
-- Q11: 1 sort key (type: VARCHAR, cardinality: 4.5M) + 1 payload column
SELECT l_shipmode, l_comment, l_partkey
FROM lineitem
ORDER BY l_shipmode
${LIMIT:-false|LIMIT 100| }

result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q11.csv