Skip to content

Commit 987b94c

Browse files
authored
chore: Add TPCDS benchmark comparison for PR (#19552)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? - Adding documentation to run TPCDS benchmarks for the existing PRs - Fixing some nits <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent 56fec71 commit 987b94c

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

benchmarks/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ To get data in `DATA_DIR` for TPCDS, please follow instructions in `./benchmarks
157157
DATA_DIR=../../datafusion-benchmarks/tpcds/data/sf1/ ./benchmarks/compare_tpcds.sh main mybranch
158158
```
159159

160-
Alternatively you can compare manually followng the example velor
160+
Alternatively, you can compare manually following the example below
161161

162162
```shell
163163
git checkout main
@@ -240,6 +240,23 @@ Benchmark tpch_mem.json
240240
└──────────────┴──────────────┴──────────────┴───────────────┘
241241
```
242242

243+
## Comparing performance of main and a PR
244+
245+
### TPCDS
246+
247+
Considering you already have TPCDS data locally
248+
249+
```shell
250+
export DATA_DIR=../../datafusion-benchmarks/tpcds/data/sf1/
251+
export PR_NUMBER=19464
252+
git fetch upstream pull/$PR_NUMBER/head:pr-$PR_NUMBER
253+
git checkout main
254+
git pull
255+
./benchmarks/compare_tpcds.sh main pr-$PR_NUMBER
256+
```
257+
258+
Note: if `gh` is installed, you can also run `gh pr checkout $PR_NUMBER` instead of `git fetch upstream pull/$PR_NUMBER/head:pr-$PR_NUMBER`
259+
243260
### Running Benchmarks Manually
244261

245262
Assuming data is in the `data` directory, the `tpch` benchmark can be run with a command like this:

benchmarks/bench.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ run_tpch_mem() {
684684

685685
# Runs the tpcds benchmark
686686
run_tpcds() {
687-
TPCDS_DIR="${DATA_DIR}/tpcds_sf1"
687+
TPCDS_DIR="${DATA_DIR}"
688688

689689
# Check if TPCDS data directory and representative file exists
690690
if [ ! -f "${TPCDS_DIR}/web_site.parquet" ]; then

datafusion/expr/src/udf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ use crate::sort_properties::{ExprProperties, SortProperties};
2424
use crate::udf_eq::UdfEq;
2525
use crate::{ColumnarValue, Documentation, Expr, Signature};
2626
use arrow::datatypes::{DataType, Field, FieldRef};
27+
#[cfg(debug_assertions)]
28+
use datafusion_common::assert_or_internal_err;
2729
use datafusion_common::config::ConfigOptions;
28-
use datafusion_common::{
29-
ExprSchema, Result, ScalarValue, assert_or_internal_err, not_impl_err,
30-
};
30+
use datafusion_common::{ExprSchema, Result, ScalarValue, not_impl_err};
3131
use datafusion_expr_common::dyn_eq::{DynEq, DynHash};
3232
use datafusion_expr_common::interval_arithmetic::Interval;
3333
use std::any::Any;

0 commit comments

Comments
 (0)