forked from apache/datafusion-ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using tpch script from datafusion-benchmarks (apache#12)
* Using tpch script from datafusion-benchmarks * Using tpch script from datafusion-benchmarks * Reverting to single partition * Removing plans, reverting to single partition * Trying one partition only * Fixing tests * One partition only * Using TPCH Dbgen from Databricks * Restored partiition count * Will tests eventually pass? * Introducing regexp for determinism * Ignored additional tests * Ignored additional tests * Update README.md
- Loading branch information
Showing
31 changed files
with
1,485 additions
and
2,311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ venv | |
*.so | ||
*.log | ||
results-sf* | ||
data | ||
tpch/tpch-dbgen |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
create_directories() { | ||
mkdir -p data | ||
} | ||
|
||
clone_and_build_tpch_dbgen() { | ||
if [ -z "$(ls -A tpch/tpch-dbgen)" ]; then | ||
echo "tpch/tpch-dbgen folder is empty. Cloning repository..." | ||
git clone https://github.com/databricks/tpch-dbgen.git tpch/tpch-dbgen | ||
cd tpch/tpch-dbgen | ||
make | ||
cd ../../ | ||
else | ||
echo "tpch/tpch-dbgen folder is not empty. Skipping cloning of TPCH dbgen." | ||
fi | ||
} | ||
|
||
generate_data() { | ||
cd tpch/tpch-dbgen | ||
if [ "$TPCH_TEST_PARTITIONS" -gt 1 ]; then | ||
for i in $(seq 1 "$TPCH_TEST_PARTITIONS"); do | ||
./dbgen -f -s "$TPCH_SCALING_FACTOR" -C "$TPCH_TEST_PARTITIONS" -S "$i" | ||
done | ||
else | ||
./dbgen -f -s "$TPCH_SCALING_FACTOR" | ||
fi | ||
mv ./*.tbl* ../../data | ||
} | ||
|
||
convert_data() { | ||
cd ../../ | ||
python -m tpch.tpchgen convert --partitions "$TPCH_TEST_PARTITIONS" | ||
} | ||
|
||
main() { | ||
if [ -z "$TPCH_TEST_PARTITIONS" ]; then | ||
echo "Error: TPCH_TEST_PARTITIONS is not set." | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$TPCH_SCALING_FACTOR" ]; then | ||
echo "Error: TPCH_SCALING_FACTOR is not set." | ||
exit 1 | ||
fi | ||
|
||
create_directories | ||
|
||
if [ -z "$(ls -A data)" ]; then | ||
clone_and_build_tpch_dbgen | ||
generate_data | ||
convert_data | ||
else | ||
echo "Data folder is not empty. Skipping cloning and data generation." | ||
fi | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# This script helps change the path to parquet files in expected plans for | ||
# local development and CI | ||
|
||
set -e | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <mode>" | ||
echo "Modes: pre-ci, local-dev" | ||
exit 1 | ||
fi | ||
|
||
# Assign the parameter to the mode variable | ||
mode=$1 | ||
|
||
ci_dir="home/runner/work/datafusion-ray/datafusion-ray" | ||
current_dir=$(pwd) | ||
current_dir_no_leading_slash="${current_dir#/}" | ||
expected_plans_dir="./testdata/expected-plans" | ||
|
||
# Function to replace paths in files | ||
replace_paths() { | ||
local search=$1 | ||
local replace=$2 | ||
find "$expected_plans_dir" -type f -exec sed -i "s|$search|$replace|g" {} + | ||
echo "Replaced all occurrences of '$search' with '$replace' in files within '$expected_plans_dir'." | ||
} | ||
|
||
# Handle the modes | ||
case $mode in | ||
pre-ci) | ||
replace_paths "$current_dir_no_leading_slash" "$ci_dir" | ||
;; | ||
local-dev) | ||
replace_paths "$ci_dir" "$current_dir_no_leading_slash" | ||
;; | ||
*) | ||
echo "Invalid mode: $mode" | ||
echo "Usage: $0 <mode>" | ||
echo "Modes: pre-ci, local-dev" | ||
exit 1 | ||
;; | ||
esac |
Oops, something went wrong.