Skip to content

Commit 489e092

Browse files
committed
benchmark: Use CSV delimiter feature for TPC-H instead of rewriting input.
Signed-off-by: Ben Pfaff <blp@feldera.com>
1 parent 20bdd2f commit 489e092

File tree

2 files changed

+19
-27
lines changed

2 files changed

+19
-27
lines changed
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
#!/bin/bash
2-
3-
set -e
1+
#!/bin/sh -e
42

53
echo "running tpc-h/generate.bash"
64
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
7-
pushd ${THIS_DIR}
8-
9-
rewrite_csv() {
10-
for i in `ls *.csv`; do
11-
csvformat -d"|" $i >x && mv x ${i}
12-
done
13-
}
5+
cd "${THIS_DIR}"
146

15-
if [[ ! -d "data-large" ]]; then
7+
if test ! -d "data-large"; then
168
git clone --quiet https://github.com/dbtoaster/dbtoaster-experiments-data.git
179
mv dbtoaster-experiments-data/tpch/big data-large
18-
cd data-large
19-
rewrite_csv
20-
cd ..
2110
mv dbtoaster-experiments-data/tpch/standard data-medium
22-
cd data-medium
23-
rewrite_csv
24-
cd ..
2511
rm -rf dbtoaster-experiments-data
2612
fi
27-
28-
popd

benchmark/feldera-sql/benchmarks/tpc-h/table.sql

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ CREATE TABLE LINEITEM (
2323
"config": {{ "path": "{folder}/data-large/lineitem.csv" }}
2424
}},
2525
"format": {{
26-
"name": "csv"
26+
"name": "csv",
27+
"config": {{ "delimiter": "|" }}
2728
}}
2829
}}]');
2930

@@ -43,7 +44,8 @@ CREATE TABLE ORDERS (
4344
"config": {{ "path": "{folder}/data-large/orders.csv" }}
4445
}},
4546
"format": {{
46-
"name": "csv"
47+
"name": "csv",
48+
"config": {{ "delimiter": "|" }}
4749
}}
4850
}}]');
4951

@@ -63,7 +65,8 @@ CREATE TABLE PART (
6365
"config": {{ "path": "{folder}/data-large/part.csv" }}
6466
}},
6567
"format": {{
66-
"name": "csv"
68+
"name": "csv",
69+
"config": {{ "delimiter": "|" }}
6770
}}
6871
}}]');
6972

@@ -82,7 +85,8 @@ CREATE TABLE CUSTOMER (
8285
"config": {{ "path": "{folder}/data-large/customer.csv" }}
8386
}},
8487
"format": {{
85-
"name": "csv"
88+
"name": "csv",
89+
"config": {{ "delimiter": "|" }}
8690
}}
8791
}}]');
8892

@@ -100,7 +104,8 @@ CREATE TABLE SUPPLIER (
100104
"config": {{ "path": "{folder}/data-large/supplier.csv" }}
101105
}},
102106
"format": {{
103-
"name": "csv"
107+
"name": "csv",
108+
"config": {{ "delimiter": "|" }}
104109
}}
105110
}}]');
106111

@@ -116,7 +121,8 @@ CREATE TABLE PARTSUPP (
116121
"config": {{ "path": "{folder}/data-large/partsupp.csv" }}
117122
}},
118123
"format": {{
119-
"name": "csv"
124+
"name": "csv",
125+
"config": {{ "delimiter": "|" }}
120126
}}
121127
}}]');
122128

@@ -131,7 +137,8 @@ CREATE TABLE NATION (
131137
"config": {{ "path": "{folder}/data-large/nation.csv" }}
132138
}},
133139
"format": {{
134-
"name": "csv"
140+
"name": "csv",
141+
"config": {{ "delimiter": "|" }}
135142
}}
136143
}}]');
137144

@@ -145,7 +152,8 @@ CREATE TABLE REGION (
145152
"config": {{ "path": "{folder}/data-large/region.csv" }}
146153
}},
147154
"format": {{
148-
"name": "csv"
155+
"name": "csv",
156+
"config": {{ "delimiter": "|" }}
149157
}}
150158
}}]');
151159

0 commit comments

Comments
 (0)