diff --git a/.gitignore b/.gitignore index 759f4fd9..848a7a9c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ __pycache__/ # Maven cache for Java builds in docker .mvn_cache/ + +# Default benchmark output directory +benchmark_output diff --git a/README.md b/README.md index b5b8eea7..fbbcf939 100644 --- a/README.md +++ b/README.md @@ -113,5 +113,9 @@ Note that `velox-testing/presto/testing/integration_tests` and `velox-testing/be ### Setting Up Benchmark Tables A couple of utility scripts have been added to facilitate the process of setting up benchmark tables either from scratch or on top of existing benchmark data (Parquet) files. Specifically, the `setup_benchmark_tables.sh` script can be used to set up a new schema and tables on top of already generated benchmark data files. Execute `./setup_benchmark_tables.sh --help` to get more details about script options. The `setup_benchmark_data_and_tables.sh` script can be used to generate benchmark data at a specified scale factor and set up a schema and tables on top of the generated data files. Execute `./setup_benchmark_data_and_tables.sh --help` to get more details about script options. Both scripts should be executed from within the `velox-testing/presto/scripts` directory. +> [!TIP] +> Add `export PRESTO_DATA_DIR={path to directory that will contain datasets}` to your `~/.bashrc` file. This avoids having to always set the `PRESTO_DATA_DIR` environment variable when executing the `start_*` scripts and/or the schema/table setup scripts. + + ## Presto Benchmarking -TODO: Add details when related infrastructure is added. +The Presto benchmarks are implemented using the [pytest](https://docs.pytest.org/en/stable/) framework and builds on top of infrastructure that was implemented for general Presto testing. Specifically, the `start_*` scripts mentioned in the "Presto Testing" section can be used to start up a Presto variant (make sure the `PRESTO_DATA_DIR` environment variable is set appropriately before running the script), and the benchmark can be run by executing the `run_benchmark.sh` script from within the `velox-testing/presto/scripts` directory. Execute `./run_benchmark.sh --help` to get more details about the benchmark script options. diff --git a/presto/scripts/run_benchmark.sh b/presto/scripts/run_benchmark.sh new file mode 100755 index 00000000..2c6f211a --- /dev/null +++ b/presto/scripts/run_benchmark.sh @@ -0,0 +1,213 @@ +#!/bin/bash + +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +print_help() { + cat << EOF + +Usage: $0 [OPTIONS] + +This script runs the specified type of benchmark. + +OPTIONS: + -h, --help Show this help message. + -b, --benchmark-type Type of benchmark to run. Only "tpch" and "tpcds" are currently supported. + -q, --queries Set of benchmark queries to run. This should be a comma separate list of query numbers. + By default, all benchmark queries are run. + -h, --hostname Hostname of the Presto coordinator. + -p, --port Port number of the Presto coordinator. + -u, --user User who queries will be executed as. + -s, --schema-name Name of the schema containing the tables that will be queried. This must be an existing + schema that contains the benchmark tables. + -o, --output-dir Directory path that will contain the output files from the benchmark run. + By default, output files are written to "$(pwd)/benchmark_output". + -i, --iterations Number of query run iterations. By default, 5 iterations are run. + -t, --tag Tag associated with the benchmark run. When a tag is specified, benchmark output will be + stored inside a directory under the --output-dir path with a name matching the tag name. + Tags must contain only alphanumeric and underscore characters. + +EXAMPLES: + $0 -b tpch -s bench_sf100 + $0 -b tpch -q "1,2" -s bench_sf100 + $0 -b tpch -s bench_sf100 -i 10 -o ~/tpch_benchmark_output + $0 -b tpch -s bench_sf100 -t gh200_cpu_sf100 + $0 -h + +EOF +} + +parse_args() { + while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + print_help + exit 0 + ;; + -b|--benchmark-type) + if [[ -n $2 ]]; then + BENCHMARK_TYPE=$2 + shift 2 + else + echo "Error: --benchmark-type requires a value" + exit 1 + fi + ;; + -q|--queries) + if [[ -n $2 ]]; then + QUERIES=$2 + shift 2 + else + echo "Error: --queries requires a value" + exit 1 + fi + ;; + -h|--hostname) + if [[ -n $2 ]]; then + HOST_NAME=$2 + shift 2 + else + echo "Error: --hostname requires a value" + exit 1 + fi + ;; + -p|--port) + if [[ -n $2 ]]; then + PORT=$2 + shift 2 + else + echo "Error: --port requires a value" + exit 1 + fi + ;; + -u|--user) + if [[ -n $2 ]]; then + USER_NAME=$2 + shift 2 + else + echo "Error: --user requires a value" + exit 1 + fi + ;; + -s|--schema-name) + if [[ -n $2 ]]; then + SCHEMA_NAME=$2 + shift 2 + else + echo "Error: --schema-name requires a value" + exit 1 + fi + ;; + -o|--output-dir) + if [[ -n $2 ]]; then + OUTPUT_DIR=$2 + shift 2 + else + echo "Error: --output-dir requires a value" + exit 1 + fi + ;; + -i|--iterations) + if [[ -n $2 ]]; then + ITERATIONS=$2 + shift 2 + else + echo "Error: --iterations requires a value" + exit 1 + fi + ;; + -t|--tag) + if [[ -n $2 ]]; then + TAG=$2 + shift 2 + else + echo "Error: --tag requires a value" + exit 1 + fi + ;; + *) + echo "Error: Unknown argument $1" + print_help + exit 1 + ;; + esac + done +} + +parse_args "$@" + +if [[ -z ${BENCHMARK_TYPE} || ! ${BENCHMARK_TYPE} =~ ^tpc(h|ds)$ ]]; then + echo "Error: A valid benchmark type (tpch or tpcds) is required. Use the -b or --benchmark-type argument." + print_help + exit 1 +fi + +if [[ -z ${SCHEMA_NAME} ]]; then + echo "Error: A schema name must be set. Use the -s or --schema-name argument." + print_help + exit 1 +fi + +PYTEST_ARGS=("--schema-name ${SCHEMA_NAME}") + +if [[ -n ${QUERIES} ]]; then + PYTEST_ARGS+=("--queries ${QUERIES}") +fi + +if [[ -n ${HOST_NAME} ]]; then + PYTEST_ARGS+=("--hostname ${HOST_NAME}") +fi + +if [[ -n ${PORT} ]]; then + PYTEST_ARGS+=("--port ${PORT}") +fi + +if [[ -n ${USER_NAME} ]]; then + PYTEST_ARGS+=("--user ${USER_NAME}") +fi + +if [[ -n ${OUTPUT_DIR} ]]; then + PYTEST_ARGS+=("--output-dir ${OUTPUT_DIR}") +fi + +if [[ -n ${ITERATIONS} ]]; then + PYTEST_ARGS+=("--iterations ${ITERATIONS}") +fi + +if [[ -n ${TAG} ]]; then + if [[ ! ${TAG} =~ ^[a-zA-Z0-9_]+$ ]]; then + echo "Error: Invalid --tag value. Tags must contain only alphanumeric and underscore characters." + print_help + exit 1 + fi + PYTEST_ARGS+=("--tag ${TAG}") +fi + +source ../../scripts/py_env_functions.sh + +trap delete_python_virtual_env EXIT + +init_python_virtual_env + +TEST_DIR=$(readlink -f ../testing) +pip install -q -r ${TEST_DIR}/requirements.txt + +source ./common_functions.sh + +wait_for_worker_node_registration "$HOST_NAME" "$PORT" + +BENCHMARK_TEST_DIR=${TEST_DIR}/performance_benchmarks +pytest -q ${BENCHMARK_TEST_DIR}/${BENCHMARK_TYPE}_test.py ${PYTEST_ARGS[*]} diff --git a/presto/scripts/run_integ_test.sh b/presto/scripts/run_integ_test.sh index a94c1f55..a01424a7 100755 --- a/presto/scripts/run_integ_test.sh +++ b/presto/scripts/run_integ_test.sh @@ -98,7 +98,7 @@ parse_args() { ;; -u|--user) if [[ -n $2 ]]; then - USER=$2 + USER_NAME=$2 shift 2 else echo "Error: --user requires a value" @@ -140,8 +140,6 @@ if [[ -z ${BENCHMARK_TYPE} || ! ${BENCHMARK_TYPE} =~ ^tpc(h|ds)$ ]]; then exit 1 fi -INTEGRATION_TEST_DIR=$(readlink -f ../testing/integration_tests) - PYTEST_ARGS=() if [[ "${KEEP_TABLES}" == "true" ]]; then @@ -160,8 +158,8 @@ if [[ -n ${PORT} ]]; then PYTEST_ARGS+=("--port ${PORT}") fi -if [[ -n ${USER} ]]; then - PYTEST_ARGS+=("--user ${USER}") +if [[ -n ${USER_NAME} ]]; then + PYTEST_ARGS+=("--user ${USER_NAME}") fi if [[ -n ${SCHEMA_NAME} ]]; then @@ -188,10 +186,12 @@ trap delete_python_virtual_env EXIT init_python_virtual_env -pip install -q -r ${INTEGRATION_TEST_DIR}/requirements.txt +TEST_DIR=$(readlink -f ../testing) +pip install -q -r ${TEST_DIR}/requirements.txt source ./common_functions.sh wait_for_worker_node_registration "$HOST_NAME" "$PORT" +INTEGRATION_TEST_DIR=${TEST_DIR}/integration_tests pytest -v ${INTEGRATION_TEST_DIR}/${BENCHMARK_TYPE}_test.py ${PYTEST_ARGS[*]} diff --git a/presto/scripts/setup_benchmark_tables.sh b/presto/scripts/setup_benchmark_tables.sh index c0d5b512..2dcbe8d9 100755 --- a/presto/scripts/setup_benchmark_tables.sh +++ b/presto/scripts/setup_benchmark_tables.sh @@ -31,6 +31,7 @@ fi SCHEMA_GEN_SCRIPT_PATH=$(readlink -f ../../benchmark_data_tools/generate_table_schemas.py) CREATE_TABLES_SCRIPT_PATH=$(readlink -f ../../presto/testing/integration_tests/create_hive_tables.py) +CREATE_TABLES_REQUIREMENTS_PATH=$(readlink -f ../../presto/testing/requirements.txt) TEMP_SCHEMA_DIR=$(readlink -f temp-schema-dir) function cleanup() { @@ -42,5 +43,5 @@ trap cleanup EXIT ../../scripts/run_py_script.sh -p $SCHEMA_GEN_SCRIPT_PATH --benchmark-type $BENCHMARK_TYPE \ --schema-name $SCHEMA_NAME --schemas-dir-path $TEMP_SCHEMA_DIR $CONVERT_DECIMALS_TO_FLOATS_ARG -../../scripts/run_py_script.sh -p $CREATE_TABLES_SCRIPT_PATH --schema-name $SCHEMA_NAME \ ---schemas-dir-path $TEMP_SCHEMA_DIR --data-dir-name $DATA_DIR_NAME +../../scripts/run_py_script.sh -p $CREATE_TABLES_SCRIPT_PATH -r $CREATE_TABLES_REQUIREMENTS_PATH \ +--schema-name $SCHEMA_NAME --schemas-dir-path $TEMP_SCHEMA_DIR --data-dir-name $DATA_DIR_NAME diff --git a/presto/testing/__init__.py b/presto/testing/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/presto/testing/common/conftest.py b/presto/testing/common/conftest.py new file mode 100644 index 00000000..21fdb8b1 --- /dev/null +++ b/presto/testing/common/conftest.py @@ -0,0 +1,70 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +def pytest_generate_tests(metafunc): + TPCH_FIXTURE_NAME = "tpch_query_id" + if TPCH_FIXTURE_NAME in metafunc.fixturenames: + TPCH_NUM_QUERIES = 22 + set_query_id_param(metafunc, TPCH_FIXTURE_NAME, TPCH_NUM_QUERIES, []) + + TPCDS_FIXTURE_NAME = "tpcds_query_id" + if TPCDS_FIXTURE_NAME in metafunc.fixturenames: + TPCDS_NUM_QUERIES = 99 + TPCDS_DISABLED_QUERIES = [ + 16, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:224: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182910_01441_uy5t2) + 32, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:162: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182915_01457_uy5t2) + 58, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:251: '=' cannot be applied to date, varchar(10)", query_id=20250815_182921_01483_uy5t2) + 70, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="Invalid reference to output of SELECT clause from grouping() expression in ORDER BY", query_id=20250815_182928_01495_uy5t2) + 72, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:886: '+' cannot be applied to date, integer", query_id=20250815_182928_01497_uy5t2) + 83, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:258: IN value and list items must be the same type: date", query_id=20250815_182930_01508_uy5t2) + 86, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="Invalid reference to output of SELECT clause from grouping() expression in ORDER BY", query_id=20250815_182935_01511_uy5t2) + 92, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:156: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182936_01517_uy5t2) + 94, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:222: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182936_01519_uy5t2) + 95, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:444: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182936_01520_uy5t2) + + # The following queries fail on presto native CPU with PrestoQueryError(type=INTERNAL_ERROR, name=GENERIC_INTERNAL_ERROR, message="Internal error", query_id=...) + 14, + 31, + 64, + 74, + 88, + ] + set_query_id_param(metafunc, TPCDS_FIXTURE_NAME, TPCDS_NUM_QUERIES, TPCDS_DISABLED_QUERIES) + + +def set_query_id_param(metafunc, param_name, num_queries, disabled_queries): + queries = metafunc.config.getoption("--queries") + metafunc.parametrize(param_name, get_query_ids(num_queries, queries, disabled_queries)) + + +def get_query_ids(num_queries, selected_query_ids, disabled_queries): + query_ids = parse_selected_query_ids(selected_query_ids, num_queries) + if len(query_ids) == 0: + query_ids = [id for id in range(1, num_queries + 1) if id not in disabled_queries] + return format_query_ids(query_ids) + + +def parse_selected_query_ids(selected_query_ids, num_queries): + query_ids = [] + if selected_query_ids and selected_query_ids.strip(): + for id_str in selected_query_ids.split(","): + id_int = int(id_str) + if id_int < 1 or id_int > num_queries: + raise ValueError(f"Invalid Query ID: {id_str}. Query ID must be between 1 and {num_queries}.") + query_ids.append(id_int) + return query_ids + + +def format_query_ids(query_ids): + return [f"Q{query_id}" for query_id in query_ids] diff --git a/presto/testing/common/fixtures.py b/presto/testing/common/fixtures.py new file mode 100644 index 00000000..49c68ecd --- /dev/null +++ b/presto/testing/common/fixtures.py @@ -0,0 +1,30 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pytest + +from . import test_utils + + +@pytest.fixture(scope="module") +def tpch_queries(request): + queries = test_utils.get_queries(request.node.obj.BENCHMARK_TYPE) + # Referencing the CTE defined "supplier_no" alias in the parent query causes issues on presto. + queries["Q15"] = queries["Q15"].replace(" AS supplier_no", "").replace("supplier_no", "l_suppkey") + return queries + + +@pytest.fixture(scope="module") +def tpcds_queries(request): + return test_utils.get_queries(request.node.obj.BENCHMARK_TYPE) diff --git a/presto/testing/integration_tests/queries/tpcds/queries.json b/presto/testing/common/queries/tpcds/queries.json similarity index 100% rename from presto/testing/integration_tests/queries/tpcds/queries.json rename to presto/testing/common/queries/tpcds/queries.json diff --git a/presto/testing/integration_tests/queries/tpch/queries.json b/presto/testing/common/queries/tpch/queries.json similarity index 100% rename from presto/testing/integration_tests/queries/tpch/queries.json rename to presto/testing/common/queries/tpch/queries.json diff --git a/presto/testing/integration_tests/schemas/tpcds/call_center.sql b/presto/testing/common/schemas/tpcds/call_center.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/call_center.sql rename to presto/testing/common/schemas/tpcds/call_center.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/catalog_page.sql b/presto/testing/common/schemas/tpcds/catalog_page.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/catalog_page.sql rename to presto/testing/common/schemas/tpcds/catalog_page.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/catalog_returns.sql b/presto/testing/common/schemas/tpcds/catalog_returns.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/catalog_returns.sql rename to presto/testing/common/schemas/tpcds/catalog_returns.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/catalog_sales.sql b/presto/testing/common/schemas/tpcds/catalog_sales.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/catalog_sales.sql rename to presto/testing/common/schemas/tpcds/catalog_sales.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/customer.sql b/presto/testing/common/schemas/tpcds/customer.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/customer.sql rename to presto/testing/common/schemas/tpcds/customer.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/customer_address.sql b/presto/testing/common/schemas/tpcds/customer_address.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/customer_address.sql rename to presto/testing/common/schemas/tpcds/customer_address.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/customer_demographics.sql b/presto/testing/common/schemas/tpcds/customer_demographics.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/customer_demographics.sql rename to presto/testing/common/schemas/tpcds/customer_demographics.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/date_dim.sql b/presto/testing/common/schemas/tpcds/date_dim.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/date_dim.sql rename to presto/testing/common/schemas/tpcds/date_dim.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/household_demographics.sql b/presto/testing/common/schemas/tpcds/household_demographics.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/household_demographics.sql rename to presto/testing/common/schemas/tpcds/household_demographics.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/income_band.sql b/presto/testing/common/schemas/tpcds/income_band.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/income_band.sql rename to presto/testing/common/schemas/tpcds/income_band.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/inventory.sql b/presto/testing/common/schemas/tpcds/inventory.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/inventory.sql rename to presto/testing/common/schemas/tpcds/inventory.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/item.sql b/presto/testing/common/schemas/tpcds/item.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/item.sql rename to presto/testing/common/schemas/tpcds/item.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/promotion.sql b/presto/testing/common/schemas/tpcds/promotion.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/promotion.sql rename to presto/testing/common/schemas/tpcds/promotion.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/reason.sql b/presto/testing/common/schemas/tpcds/reason.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/reason.sql rename to presto/testing/common/schemas/tpcds/reason.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/ship_mode.sql b/presto/testing/common/schemas/tpcds/ship_mode.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/ship_mode.sql rename to presto/testing/common/schemas/tpcds/ship_mode.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/store.sql b/presto/testing/common/schemas/tpcds/store.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/store.sql rename to presto/testing/common/schemas/tpcds/store.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/store_returns.sql b/presto/testing/common/schemas/tpcds/store_returns.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/store_returns.sql rename to presto/testing/common/schemas/tpcds/store_returns.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/store_sales.sql b/presto/testing/common/schemas/tpcds/store_sales.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/store_sales.sql rename to presto/testing/common/schemas/tpcds/store_sales.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/time_dim.sql b/presto/testing/common/schemas/tpcds/time_dim.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/time_dim.sql rename to presto/testing/common/schemas/tpcds/time_dim.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/warehouse.sql b/presto/testing/common/schemas/tpcds/warehouse.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/warehouse.sql rename to presto/testing/common/schemas/tpcds/warehouse.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/web_page.sql b/presto/testing/common/schemas/tpcds/web_page.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/web_page.sql rename to presto/testing/common/schemas/tpcds/web_page.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/web_returns.sql b/presto/testing/common/schemas/tpcds/web_returns.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/web_returns.sql rename to presto/testing/common/schemas/tpcds/web_returns.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/web_sales.sql b/presto/testing/common/schemas/tpcds/web_sales.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/web_sales.sql rename to presto/testing/common/schemas/tpcds/web_sales.sql diff --git a/presto/testing/integration_tests/schemas/tpcds/web_site.sql b/presto/testing/common/schemas/tpcds/web_site.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpcds/web_site.sql rename to presto/testing/common/schemas/tpcds/web_site.sql diff --git a/presto/testing/integration_tests/schemas/tpch/customer.sql b/presto/testing/common/schemas/tpch/customer.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/customer.sql rename to presto/testing/common/schemas/tpch/customer.sql diff --git a/presto/testing/integration_tests/schemas/tpch/lineitem.sql b/presto/testing/common/schemas/tpch/lineitem.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/lineitem.sql rename to presto/testing/common/schemas/tpch/lineitem.sql diff --git a/presto/testing/integration_tests/schemas/tpch/nation.sql b/presto/testing/common/schemas/tpch/nation.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/nation.sql rename to presto/testing/common/schemas/tpch/nation.sql diff --git a/presto/testing/integration_tests/schemas/tpch/orders.sql b/presto/testing/common/schemas/tpch/orders.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/orders.sql rename to presto/testing/common/schemas/tpch/orders.sql diff --git a/presto/testing/integration_tests/schemas/tpch/part.sql b/presto/testing/common/schemas/tpch/part.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/part.sql rename to presto/testing/common/schemas/tpch/part.sql diff --git a/presto/testing/integration_tests/schemas/tpch/partsupp.sql b/presto/testing/common/schemas/tpch/partsupp.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/partsupp.sql rename to presto/testing/common/schemas/tpch/partsupp.sql diff --git a/presto/testing/integration_tests/schemas/tpch/region.sql b/presto/testing/common/schemas/tpch/region.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/region.sql rename to presto/testing/common/schemas/tpch/region.sql diff --git a/presto/testing/integration_tests/schemas/tpch/supplier.sql b/presto/testing/common/schemas/tpch/supplier.sql similarity index 100% rename from presto/testing/integration_tests/schemas/tpch/supplier.sql rename to presto/testing/common/schemas/tpch/supplier.sql diff --git a/presto/testing/common/test_utils.py b/presto/testing/common/test_utils.py new file mode 100644 index 00000000..603ea50e --- /dev/null +++ b/presto/testing/common/test_utils.py @@ -0,0 +1,25 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import json + + +def get_queries(benchmark_type): + with open(get_abs_file_path(f"./queries/{benchmark_type}/queries.json"), "r") as file: + return json.load(file) + + +def get_abs_file_path(relative_path): + return os.path.abspath(os.path.join(os.path.dirname(__file__), relative_path)) diff --git a/presto/testing/integration_tests/common_fixtures.py b/presto/testing/integration_tests/common_fixtures.py index 17f2693c..d8d1caca 100644 --- a/presto/testing/integration_tests/common_fixtures.py +++ b/presto/testing/integration_tests/common_fixtures.py @@ -50,7 +50,7 @@ def setup_and_teardown(request, presto_cursor): should_create_tables = not has_schema_name if should_create_tables: schema_name = f"{benchmark_type}_test" - schemas_dir = test_utils.get_abs_file_path(f"schemas/{benchmark_type}") + schemas_dir = test_utils.get_abs_file_path(f"../common/schemas/{benchmark_type}") data_sub_directory = f"integration_test/{benchmark_type}" create_hive_tables.create_tables(presto_cursor, schema_name, schemas_dir, data_sub_directory) diff --git a/presto/testing/integration_tests/conftest.py b/presto/testing/integration_tests/conftest.py index f81d3c67..c1e7e6e0 100644 --- a/presto/testing/integration_tests/conftest.py +++ b/presto/testing/integration_tests/conftest.py @@ -12,69 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from ..common.conftest import * + def pytest_addoption(parser): parser.addoption("--queries") parser.addoption("--keep-tables", action="store_true", default=False) parser.addoption("--hostname", default="localhost") - parser.addoption("--port", default=8080) + parser.addoption("--port", default=8080, type=int) parser.addoption("--user", default="test_user") parser.addoption("--schema-name") parser.addoption("--scale-factor") - - -def pytest_generate_tests(metafunc): - TPCH_FIXTURE_NAME = "tpch_query_id" - if TPCH_FIXTURE_NAME in metafunc.fixturenames: - TPCH_NUM_QUERIES = 22 - set_query_id_param(metafunc, TPCH_FIXTURE_NAME, TPCH_NUM_QUERIES, []) - - TPCDS_FIXTURE_NAME = "tpcds_query_id" - if TPCDS_FIXTURE_NAME in metafunc.fixturenames: - TPCDS_NUM_QUERIES = 99 - TPCDS_DISABLED_QUERIES = [ - 16, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:224: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182910_01441_uy5t2) - 32, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:162: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182915_01457_uy5t2) - 58, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:251: '=' cannot be applied to date, varchar(10)", query_id=20250815_182921_01483_uy5t2) - 70, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="Invalid reference to output of SELECT clause from grouping() expression in ORDER BY", query_id=20250815_182928_01495_uy5t2) - 72, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:886: '+' cannot be applied to date, integer", query_id=20250815_182928_01497_uy5t2) - 83, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:258: IN value and list items must be the same type: date", query_id=20250815_182930_01508_uy5t2) - 86, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="Invalid reference to output of SELECT clause from grouping() expression in ORDER BY", query_id=20250815_182935_01511_uy5t2) - 92, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:156: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182936_01517_uy5t2) - 94, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:222: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182936_01519_uy5t2) - 95, # PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:444: Cannot check if date is BETWEEN varchar(10) and date", query_id=20250815_182936_01520_uy5t2) - - # The following queries fail on presto native CPU with PrestoQueryError(type=INTERNAL_ERROR, name=GENERIC_INTERNAL_ERROR, message="Internal error", query_id=...) - 14, - 31, - 64, - 74, - 88, - ] - set_query_id_param(metafunc, TPCDS_FIXTURE_NAME, TPCDS_NUM_QUERIES, TPCDS_DISABLED_QUERIES) - - -def set_query_id_param(metafunc, param_name, num_queries, disabled_queries): - queries = metafunc.config.getoption("--queries") - metafunc.parametrize(param_name, get_query_ids(num_queries, queries, disabled_queries)) - - -def get_query_ids(num_queries, selected_query_ids, disabled_queries): - query_ids = parse_selected_query_ids(selected_query_ids, num_queries) - if len(query_ids) == 0: - query_ids = [id for id in range(1, num_queries + 1) if id not in disabled_queries] - return format_query_ids(query_ids) - - -def parse_selected_query_ids(selected_query_ids, num_queries): - query_ids = [] - if selected_query_ids and selected_query_ids.strip(): - for id_str in selected_query_ids.split(","): - id_int = int(id_str) - if id_int < 1 or id_int > num_queries: - raise ValueError(f"Invalid Query ID: {id_str}. Query ID must be between 1 and {num_queries}.") - query_ids.append(id_int) - return query_ids - - -def format_query_ids(query_ids): - return [f"Q{query_id}" for query_id in query_ids] diff --git a/presto/testing/integration_tests/scripts/generate_test_files.sh b/presto/testing/integration_tests/scripts/generate_test_files.sh index 0339a908..7b91db40 100755 --- a/presto/testing/integration_tests/scripts/generate_test_files.sh +++ b/presto/testing/integration_tests/scripts/generate_test_files.sh @@ -116,7 +116,7 @@ fi echo "Generating required test files for ${BENCHMARK_TYPES_TO_GENERATE[@]} benchmark(s)..." for BENCHMARK_TYPE in "${BENCHMARK_TYPES_TO_GENERATE[@]}"; do - SCHEMAS_DIR=../schemas/$BENCHMARK_TYPE + SCHEMAS_DIR=../../common/schemas/$BENCHMARK_TYPE SCHEMA_NAME=${BENCHMARK_TYPE}_test rm -rf $SCHEMAS_DIR echo "Generating table schema files for $BENCHMARK_TYPE..." @@ -124,7 +124,7 @@ for BENCHMARK_TYPE in "${BENCHMARK_TYPES_TO_GENERATE[@]}"; do --schema-name $SCHEMA_NAME --schemas-dir-path $SCHEMAS_DIR $CONVERT_DECIMALS_TO_FLOATS_ARG echo "Table schema files generated for $BENCHMARK_TYPE" - QUERIES_DIR=../queries/$BENCHMARK_TYPE + QUERIES_DIR=../../common/queries/$BENCHMARK_TYPE rm -rf $QUERIES_DIR echo "Generating benchmark queries file for $BENCHMARK_TYPE..." python $BENCHMARK_DATA_TOOLS_DIR/generate_query_file.py --benchmark-type $BENCHMARK_TYPE \ diff --git a/presto/testing/integration_tests/test_utils.py b/presto/testing/integration_tests/test_utils.py index 48760c44..5ed2479c 100644 --- a/presto/testing/integration_tests/test_utils.py +++ b/presto/testing/integration_tests/test_utils.py @@ -30,11 +30,6 @@ def get_abs_file_path(relative_path): from duckdb_utils import init_benchmark_tables -def get_queries(benchmark_type): - with open(get_abs_file_path(f"queries/{benchmark_type}/queries.json"), "r") as file: - return json.load(file) - - def execute_query_and_compare_results(presto_cursor, queries, query_id): query = queries[query_id] diff --git a/presto/testing/integration_tests/tpcds_test.py b/presto/testing/integration_tests/tpcds_test.py index ee05c4e2..2ec823e3 100644 --- a/presto/testing/integration_tests/tpcds_test.py +++ b/presto/testing/integration_tests/tpcds_test.py @@ -16,15 +16,11 @@ from . import test_utils from .common_fixtures import presto_cursor, setup_and_teardown +from ..common.fixtures import tpcds_queries BENCHMARK_TYPE = "tpcds" -@pytest.fixture(scope="module") -def tpcds_queries(): - return test_utils.get_queries(BENCHMARK_TYPE) - - @pytest.mark.usefixtures("setup_and_teardown") def test_query(presto_cursor, tpcds_queries, tpcds_query_id): test_utils.execute_query_and_compare_results(presto_cursor, tpcds_queries, tpcds_query_id) diff --git a/presto/testing/integration_tests/tpch_test.py b/presto/testing/integration_tests/tpch_test.py index c9fb2a3d..fd2977ba 100644 --- a/presto/testing/integration_tests/tpch_test.py +++ b/presto/testing/integration_tests/tpch_test.py @@ -16,18 +16,11 @@ from . import test_utils from .common_fixtures import presto_cursor, setup_and_teardown +from ..common.fixtures import tpch_queries BENCHMARK_TYPE = "tpch" -@pytest.fixture(scope="module") -def tpch_queries(): - queries = test_utils.get_queries(BENCHMARK_TYPE) - # Referencing the CTE defined "supplier_no" alias in the parent query causes issues on presto. - queries["Q15"] = queries["Q15"].replace(" AS supplier_no", "").replace("supplier_no", "l_suppkey") - return queries - - @pytest.mark.usefixtures("setup_and_teardown") def test_query(presto_cursor, tpch_queries, tpch_query_id): test_utils.execute_query_and_compare_results(presto_cursor, tpch_queries, tpch_query_id) diff --git a/presto/testing/performance_benchmarks/__init__.py b/presto/testing/performance_benchmarks/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/presto/testing/performance_benchmarks/benchmark_keys.py b/presto/testing/performance_benchmarks/benchmark_keys.py new file mode 100644 index 00000000..a867fe9c --- /dev/null +++ b/presto/testing/performance_benchmarks/benchmark_keys.py @@ -0,0 +1,28 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from enum import Enum + +class BenchmarkKeys(str, Enum): + RAW_TIMES_KEY = "raw_times_ms" + FAILED_QUERIES_KEY = "failed_queries" + FORMAT_WIDTH_KEY = "format_width" + AGGREGATE_TIMES_KEY = "agg_times_ms" + AGGREGATE_TIMES_FIELDS_KEY = "agg_times_fields" + AVG_KEY = "avg" + MIN_KEY = "min" + MAX_KEY = "max" + MEDIAN_KEY = "median" + GMEAN_KEY = "geometric_mean" + TAG_KEY = "tag" diff --git a/presto/testing/performance_benchmarks/common_fixtures.py b/presto/testing/performance_benchmarks/common_fixtures.py new file mode 100644 index 00000000..f5258266 --- /dev/null +++ b/presto/testing/performance_benchmarks/common_fixtures.py @@ -0,0 +1,78 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import prestodb +import pytest + +from .benchmark_keys import BenchmarkKeys +from ..common.fixtures import tpch_queries, tpcds_queries + + +@pytest.fixture(scope="module") +def presto_cursor(request): + hostname = request.config.getoption("--hostname") + port = request.config.getoption("--port") + user = request.config.getoption("--user") + schema = request.config.getoption("--schema-name") + conn = prestodb.dbapi.connect(host=hostname, port=port, user=user, catalog="hive", + schema=schema) + return conn.cursor() + + +@pytest.fixture(scope="session") +def benchmark_result_collector(request): + benchmark_results = {} + yield benchmark_results + + request.session.benchmark_results = benchmark_results + + +@pytest.fixture(scope="module") +def benchmark_queries(request, tpch_queries, tpcds_queries): + if request.node.obj.BENCHMARK_TYPE == "tpch": + return tpch_queries + else: + assert request.node.obj.BENCHMARK_TYPE == "tpcds" + return tpcds_queries + + +@pytest.fixture(scope="module") +def benchmark_query(request, presto_cursor, benchmark_queries, benchmark_result_collector): + iterations = request.config.getoption("--iterations") + + benchmark_result_collector[request.node.obj.BENCHMARK_TYPE] = { + BenchmarkKeys.RAW_TIMES_KEY: {}, + BenchmarkKeys.FAILED_QUERIES_KEY: {}, + } + + benchmark_dict = benchmark_result_collector[request.node.obj.BENCHMARK_TYPE] + raw_times_dict = benchmark_dict[BenchmarkKeys.RAW_TIMES_KEY] + assert raw_times_dict == {} + + failed_queries_dict = benchmark_dict[BenchmarkKeys.FAILED_QUERIES_KEY] + assert failed_queries_dict == {} + + def benchmark_query_function(query_id): + try: + result = [ + presto_cursor.execute(benchmark_queries[query_id]).stats["elapsedTimeMillis"] + for _ in range(iterations) + ] + raw_times_dict[query_id] = result + except Exception as e: + failed_queries_dict[query_id] = f"{e.error_type}: {e.error_name}" + raw_times_dict[query_id] = None + raise + + return benchmark_query_function diff --git a/presto/testing/performance_benchmarks/conftest.py b/presto/testing/performance_benchmarks/conftest.py new file mode 100644 index 00000000..d7b7367b --- /dev/null +++ b/presto/testing/performance_benchmarks/conftest.py @@ -0,0 +1,103 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import statistics + +from pathlib import Path +from .benchmark_keys import BenchmarkKeys +from ..common.conftest import * + + +def pytest_addoption(parser): + parser.addoption("--queries") + parser.addoption("--schema-name", required=True) + parser.addoption("--hostname", default="localhost") + parser.addoption("--port", default=8080, type=int) + parser.addoption("--user", default="test_user") + parser.addoption("--iterations", default=5, type=int) + parser.addoption("--output-dir", default="benchmark_output") + parser.addoption("--tag") + + +def pytest_terminal_summary(terminalreporter, exitstatus, config): + for benchmark_type, result in terminalreporter._session.benchmark_results.items(): + assert BenchmarkKeys.AGGREGATE_TIMES_KEY in result + + terminalreporter.write_line("") + terminalreporter.section(f"{benchmark_type} Benchmark Summary", sep="-", bold=True, yellow=True) + + AGG_HEADERS = ["Avg(ms)", "Min(ms)", "Max(ms)", "Median(ms)", "GMean(ms)"] + width = max([len(agg_header) for agg_header in AGG_HEADERS]) + width = max(width, result[BenchmarkKeys.FORMAT_WIDTH_KEY]) + 2 # Additional padding on each side + header = " Query ID " + for agg_header in AGG_HEADERS: + header += f"|{agg_header:^{width}}" + terminalreporter.write_line(header) + terminalreporter.write_line("-" * len(header), bold=True, yellow=True) + for query_id, agg_timings in result[BenchmarkKeys.AGGREGATE_TIMES_KEY].items(): + line = f"{query_id:^10}" + if agg_timings: + for agg_timing in agg_timings: + line += f"|{agg_timing:^{width}}" + else: + line += (f"|{'NULL':^{width}}" * len(AGG_HEADERS)) + terminalreporter.write_line(line) + terminalreporter.write_line("") + + +def pytest_sessionfinish(session, exitstatus): + bench_output_dir = session.config.getoption("--output-dir") + tag = session.config.getoption("--tag") + json_result = {} + + if tag: + bench_output_dir = f"{bench_output_dir}/{tag}" + json_result[BenchmarkKeys.TAG_KEY] = tag + Path(bench_output_dir).mkdir(parents=True, exist_ok=True) + + AGG_KEYS = [BenchmarkKeys.AVG_KEY, BenchmarkKeys.MIN_KEY, BenchmarkKeys.MAX_KEY, + BenchmarkKeys.MEDIAN_KEY, BenchmarkKeys.GMEAN_KEY] + for benchmark_type, result in session.benchmark_results.items(): + compute_aggregate_timings(result) + json_result[benchmark_type] = { + BenchmarkKeys.AGGREGATE_TIMES_KEY: {}, + BenchmarkKeys.FAILED_QUERIES_KEY: result[BenchmarkKeys.FAILED_QUERIES_KEY], + } + json_agg_timings = json_result[benchmark_type][BenchmarkKeys.AGGREGATE_TIMES_KEY] + for agg_key in AGG_KEYS: + json_agg_timings[agg_key] = {} + for query_id, agg_timings in result[BenchmarkKeys.AGGREGATE_TIMES_KEY].items(): + if agg_timings: + for i, agg_key in enumerate(AGG_KEYS): + json_agg_timings[agg_key][query_id] = agg_timings[i] + + with open(f"{bench_output_dir}/benchmark_result.json", "w") as file: + json.dump(json_result, file, indent=2) + file.write("\n") + + +def compute_aggregate_timings(benchmark_results): + raw_times = benchmark_results[BenchmarkKeys.RAW_TIMES_KEY] + benchmark_results[BenchmarkKeys.AGGREGATE_TIMES_KEY] = {} + format_width = 0 + for query_id, timings in raw_times.items(): + if timings: + stats = (round(statistics.mean(timings), 2), min(timings), max(timings), + statistics.median(timings), round(statistics.geometric_mean(timings), 2)) + format_width = max(format_width, *[len(str(stat)) for stat in stats]) + else: + stats = None + benchmark_results[BenchmarkKeys.AGGREGATE_TIMES_KEY][query_id] = stats + benchmark_results[BenchmarkKeys.FORMAT_WIDTH_KEY] = format_width diff --git a/presto/testing/performance_benchmarks/tpcds_test.py b/presto/testing/performance_benchmarks/tpcds_test.py new file mode 100644 index 00000000..9af661a1 --- /dev/null +++ b/presto/testing/performance_benchmarks/tpcds_test.py @@ -0,0 +1,21 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .common_fixtures import * + +BENCHMARK_TYPE = "tpcds" + + +def test_query(benchmark_query, tpcds_query_id): + benchmark_query(tpcds_query_id) diff --git a/presto/testing/performance_benchmarks/tpch_test.py b/presto/testing/performance_benchmarks/tpch_test.py new file mode 100644 index 00000000..2c94afb8 --- /dev/null +++ b/presto/testing/performance_benchmarks/tpch_test.py @@ -0,0 +1,21 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .common_fixtures import * + +BENCHMARK_TYPE = "tpch" + + +def test_query(benchmark_query, tpch_query_id): + benchmark_query(tpch_query_id) diff --git a/presto/testing/integration_tests/requirements.txt b/presto/testing/requirements.txt similarity index 100% rename from presto/testing/integration_tests/requirements.txt rename to presto/testing/requirements.txt