-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(script): generate tpch data set
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,6 @@ venv/ | |
__pycache__/ | ||
|
||
*.zip | ||
|
||
# tpch data set | ||
tpch/data |
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,7 @@ | ||
#!/bin/bash | ||
# Copyright 2020-2021 The Databend Authors. | ||
# SPDX-License-Identifier: Apache-2.0. | ||
|
||
cd /tpch-dbgen | ||
./dbgen -vf -s 1 | ||
mv *.tbl /data |
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,16 @@ | ||
#!/bin/bash | ||
# Copyright 2020-2021 The Databend Authors. | ||
# SPDX-License-Identifier: Apache-2.0. | ||
|
||
# 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 |
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,17 @@ | ||
# Copyright 2020-2021 The Databend Authors. | ||
# SPDX-License-Identifier: Apache-2.0. | ||
|
||
FROM ubuntu:22.04 | ||
|
||
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 | ||
|
||
WORKDIR /tpch-dbgen | ||
ADD run-tpch-dbgen.sh /tpch-dbgen/ | ||
|
||
VOLUME /data | ||
|
||
ENTRYPOINT [ "bash", "./run-tpch-dbgen.sh" ] |