Skip to content

Commit

Permalink
test(tpc-h): add tpc-h tests with pushdown (IGinX-THU#477)
Browse files Browse the repository at this point in the history
增加TPC-H下推测试
  • Loading branch information
jzl18thu authored Nov 1, 2024
1 parent 132b10c commit c6b2c43
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/standard-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ jobs:
with:
os-matrix: '["ubuntu-latest"]'
metadata-matrix: '["zookeeper"]'
tpc-h-regression-test-pushdown:
uses: ./.github/workflows/tpc-h-pushdown.yml
with:
os-matrix: '["ubuntu-latest"]'
metadata-matrix: '["zookeeper"]'
db-matrix: '["InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL"]'
199 changes: 199 additions & 0 deletions .github/workflows/tpc-h-pushdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: "TPC-H Regression Test With Push Down"

on:
workflow_call:
inputs:
java-matrix:
description: "The java version to run the test on"
type: string
required: false
default: '["8"]'
python-matrix:
description: "The python version to run the test on"
type: string
required: false
default: '["3.9"]'
os-matrix:
description: "The operating system to run the test on"
type: string
required: false
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'
metadata-matrix:
description: "The metadata to run the test on"
type: string
required: false
default: '["zookeeper", "etcd"]'
db-matrix:
description: "The database to run the test on"
type: string
required: false
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL"]'

jobs:
TPC-H-Test-Push_Down:
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
java: ${{ fromJSON(inputs.java-matrix) }}
python-version: ${{ fromJSON(inputs.python-matrix) }}
os: ${{ fromJSON(inputs.os-matrix) }}
metadata: ${{ fromJSON(inputs.metadata-matrix) }}
DB-name: ${{ fromJSON(inputs.db-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Environment dependence
uses: ./.github/actions/dependence
with:
python-version: ${{ matrix.python-version }}
java: ${{ matrix.java }}

- name: Display System Info
shell: bash
run: |
echo "Operating System: $(uname -a 2>/dev/null || ver)"
echo "Architecture: $(uname -m 2>/dev/null || echo %PROCESSOR_ARCHITECTURE%)"
echo "Java Version:"
java -version
echo "Python Version:"
python --version
echo "CPU Info:"
if [ "$(uname)" = "Linux" ]; then
lscpu
elif [ "$(uname)" = "Darwin" ]; then
sysctl -n machdep.cpu.brand_string
else
wmic cpu get name
fi
echo "Memory Info:"
if [ "$(uname)" = "Linux" ]; then
free -h
elif [ "$(uname)" = "Darwin" ]; then
vm_stat
else
systeminfo | findstr /C:"Total Physical Memory"
fi
- name: Download TPC-H Data
shell: bash
run: |
wget https://github.com/IGinX-THU/IGinX-resources/raw/main/resources/tpc.7z
sudo apt-get install p7zip-full
7za x tpc.7z
ls tpc
- name: Run ZooKeeper
uses: ./.github/actions/zookeeperRunner

- name: Run DB
uses: ./.github/actions/dbRunner
with:
DB-name: ${{ matrix.DB-name }}

- name: Get Old Version IGinX
shell: bash
run: |
git clone https://github.com/IGinX-THU/IGinX.git
cp -rf test/src/test/resources/tpch/queries/* IGinX/test/src/test/resources/tpch/queries/
cp -rf test/src/test/resources/tpch/sf0.1/* IGinX/test/src/test/resources/tpch/sf0.1/
cp -rf test/src/test/resources/tpch/udf/* IGinX/test/src/test/resources/tpch/udf/
cp -f test/src/test/resources/testConfig.properties IGinX/test/src/test/resources/testConfig.properties
# 新增tpc-h查询测试时,旧版本代码中没有这些查询,需从新分支复制过去,添加完所有的tpc_h测试后可删除这些复制命令

- name: Rewrite DB Conf in Old IGinX
uses: ./.github/actions/dbConfWriter
with:
DB-name: ${{ matrix.DB-name }}
Root-Dir-Path: "IGinX"

- name: Install Old IGinX with Maven
shell: bash
run: |
cd IGinX
mvn clean package -DskipTests -P-format -q
cp -rf ${GITHUB_WORKSPACE}/test/src/test/resources/tpch/udf/* core/target/iginx-core-${VERSION}/udf_funcs/python_scripts/
- name: Change Old IGinX Config
uses: ./.github/actions/confWriter
with:
DB-name: ${{ matrix.DB-name }}
Push-Down: "true"
Set-Filter-Fragment-OFF: "true"
Metadata: ${{ matrix.metadata }}
Root-Dir-Path: "IGinX"

- name: Install New IGinX with Maven
shell: bash
run: mvn clean package -DskipTests -P-format -q

- name: Change New IGinX Config
uses: ./.github/actions/confWriter
with:
DB-name: ${{ matrix.DB-name }}
Push-Down: "true"
Set-Filter-Fragment-OFF: "true"
Metadata: ${{ matrix.metadata }}

- name: Insert Data into DB
uses: ./.github/actions/tpchDataWriter
with:
DB-name: ${{ matrix.DB-name }}

- name: Run 1st Regression Test
id: test1
uses: ./.github/actions/tpchSingleTest

- name: Run 2nd Regression Test
id: test2
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test1.outputs.status }}

- name: Run 3rd Regression Test
id: test3
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test2.outputs.status }}

- name: Run 4th Regression Test
id: test4
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test3.outputs.status }}

- name: Run 5th Regression Test
id: test5
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test4.outputs.status }}

- name: Run 6th Regression Test
id: test6
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test5.outputs.status }}

- name: Run 7th Regression Test
id: test7
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test6.outputs.status }}

- name: Run 8th Regression Test
id: test8
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test7.outputs.status }}

- name: Run 9th Regression Test
id: test9
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test8.outputs.status }}

- name: Run 10th Regression Test
id: test10
uses: ./.github/actions/tpchSingleTest
with:
status: ${{ steps.test9.outputs.status }}
1 change: 1 addition & 0 deletions .github/workflows/tpc-h.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
run: |
cd IGinX
mvn clean package -DskipTests -P-format -q
cp -rf ${GITHUB_WORKSPACE}/test/src/test/resources/tpch/udf/* core/target/iginx-core-${VERSION}/udf_funcs/python_scripts/
- name: Change Old IGinX Config
uses: ./.github/actions/confWriter
Expand Down
2 changes: 1 addition & 1 deletion test/src/test/resources/testConfig.properties
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ is_scaling=false
DBCE_test_way=oriHasDataExpHasData

# TPC-H test
query_ids=1,2,3,4,5,6,9,10,13,16,17,19,20,21
query_ids=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
max_repetitions_num=10
regression_threshold=0.3

0 comments on commit c6b2c43

Please sign in to comment.