if __name__ == "__main__": from xbb_tools.cluster_startup import attach_to_cluster, import_query_libs from xbb_tools.utils import run_query, tpcxbb_argparser import_query_libs() dask_queries = { qnum: load_query(qnum, f"queries/q{qnum}/tpcx_bb_query_{qnum}.py") for qnum in dask_qnums } bsql_queries = { qnum: load_query(qnum, f"queries/q{qnum}/tpcx_bb_query_{qnum}_sql.py") for qnum in bsql_qnums } config = tpcxbb_argparser() include_blazing = config.get("benchmark_runner_include_bsql") client, bc = attach_to_cluster(config, create_blazing_context=include_blazing) # Preload required libraries for queries on all workers client.run(import_query_libs) base_path = os.getcwd() # Run BSQL Queries if include_blazing and len(bsql_qnums) > 0: print("Blazing Queries") for qnum, q_func in bsql_queries.items(): print(qnum) qpath = f"{base_path}/queries/q{qnum}/"
import sys from blazingsql import BlazingContext from xbb_tools.cluster_startup import attach_to_cluster from dask_cuda import LocalCUDACluster from dask.distributed import Client import os from xbb_tools.utils import ( benchmark, tpcxbb_argparser, write_result, ) cli_args = tpcxbb_argparser() @benchmark(dask_profile=cli_args["dask_profile"]) def read_tables(data_dir): bc.create_table("web_sales", data_dir + "/web_sales/*.parquet") bc.create_table("item", data_dir + "/item/*.parquet") bc.create_table("item_marketprices", data_dir + "/item_marketprices/*.parquet") bc.create_table("store_sales", data_dir + "/store_sales/*.parquet") @benchmark(dask_profile=cli_args["dask_profile"]) def main(data_dir): read_tables(data_dir)