主要内容

Generate Benchmark Data Using DuckDB TPC-H Extension

R2026b

Use the DuckDB™ TPC‑H extension to generate benchmark data, then query the data by joining the customer and nation tables with a row filter.

Create a transient, in-memory DuckDB database connection with the duckdb function.

conn = duckdb();

Generate TPC‑H benchmark data at scale factor 1.

execute(conn,"CALL dbgen(sf = 1)")

Filter the joined customer and nation tables to include only rows where n_name = "UNITED STATES".

rf = rowfilter("n_name");
rf = rf.n_name == "UNITED STATES";

custUSA = sqlinnerjoin(conn, ...
    "customer","nation", ...
    LeftKeys="c_nationkey", ...
    RightKeys="n_nationkey", ...
    RowFilter=rf);

Close the database connection.

close(conn);

See Also

| | | |

External Websites