Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(script): generate tpch data set #6024

Merged
merged 5 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ venv/
__pycache__/

*.zip

# tpch data set
tpch/data
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ header:
- "website"
- "tests"
- "tools"
- "tpch"
# Ignore hidden files
- ".cargo"
- ".databend"
Expand Down
5 changes: 5 additions & 0 deletions tpch/run-tpch-dbgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

xudong963 marked this conversation as resolved.
Show resolved Hide resolved
cd /tpch-dbgen
./dbgen -vf -s 1
xudong963 marked this conversation as resolved.
Show resolved Hide resolved
mv *.tbl /data
14 changes: 14 additions & 0 deletions tpch/tpch-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Construct a docker imagine to generate tpch-data
docker build -f tpchdata.dockerfile -t databend:latest .

# Generate data into the ./data directory if it does not already exist
FILE=./data/customer.tbl
if test -f "$FILE"; then
echo "$FILE exists."
else
mkdir data 2>/dev/null
docker run -v `pwd`/data:/data --rm databend:latest
ls -l data
fi
14 changes: 14 additions & 0 deletions tpch/tpchdata.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:22.04
xudong963 marked this conversation as resolved.
Show resolved Hide resolved

RUN apt-get update && \
apt-get install -y git build-essential

# Use https://github.com/databricks/tpch-dbgen to generate data
RUN git clone https://github.com/databricks/tpch-dbgen.git && cd tpch-dbgen && make
xudong963 marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /tpch-dbgen
ADD run-tpch-dbgen.sh /tpch-dbgen/

VOLUME /data

ENTRYPOINT [ "bash", "./run-tpch-dbgen.sh" ]