From b8318b88d19594f52c277a26c3857a346cbc7d15 Mon Sep 17 00:00:00 2001
From: "qiyuan.liu" <1043276694@qq.com>
Date: Fri, 2 Feb 2024 20:56:07 +0800
Subject: [PATCH] test: add apiserver integration test (#3674)
---
.github/workflows/integration-test-src.yml | 6 -
.github/workflows/selfhost_intergration.yml | 145 +++++++-----
.../cluster/window_and_lastjoin.yaml | 164 +++++++-------
.../expression/test_type.yaml | 6 +-
.../function/test_udaf_function.yaml | 72 +++---
.../join/test_lastjoin_simple.yaml | 19 +-
.../long_window/test_long_window_batch.yaml | 1 +
.../integration_test/window/error_window.yaml | 2 +-
.../tests/hooks/test_openmldb_api_hook.py | 4 +-
test/integration-test/README | 31 +++
.../openmldb-test-java/kafka_test.sh | 18 ++
.../openmldb-http-test/pom.xml | 58 +++--
.../openmldb/http_test/check/DataChecker.java | 2 +-
.../http_test/common/ClusterTest.java | 6 +-
.../http_test/config/FedbRestfulConfig.java | 3 +-
.../executor/RestfulOnlineExecutor.java | 179 +++++++++++++++
.../openmldb/http_test/util/HttpUtil.java | 206 ++++++++++++++++++
.../openmldb/http_test/util/RowsSort.java | 61 ++++++
.../TestCluster.java} | 29 ++-
.../openmldb/http_test/tmp/TestDropTable.java | 52 -----
.../http_test/tmp/TestExpression.java | 38 ++++
.../openmldb/http_test/tmp/TestFunction.java | 37 ++++
.../TestIndexOptimized.java} | 30 +--
.../openmldb/http_test/tmp/TestJoin.java | 41 ++++
.../http_test/tmp/TestLongWindow.java | 37 ++++
.../openmldb/http_test/tmp/TestMultiDB.java | 36 +++
.../openmldb/http_test/tmp/TestSelect.java | 38 ++++
.../TestInsert.java => tmp/TestTmp.java} | 28 ++-
.../http_test/v230/TestProcedure.java | 42 ----
.../openmldb/http_test/v230/TestShow.java | 49 -----
.../test_suite/test_all.xml | 26 ++-
.../java_sdk_test/checker/OptionsChecker.java | 2 +-
.../java_sdk_test/executor/BaseExecutor.java | 3 +-
.../executor/BaseSQLExecutor.java | 2 -
.../executor/BatchSQLExecutor.java | 5 +-
.../executor/OfflineJobExecuter.java | 7 +-
.../executor/RequestQuerySQLExecutor.java | 4 +
.../high_availability/HighDiskTableTest.java | 1 -
.../test_common/bean/OpenMLDBResult.java | 4 +
.../command/OpenMLDBCommandUtil.java | 40 ++--
.../test_common/common/BaseExecutor.java | 72 ++++++
.../openmldb/test_common/common/BaseTest.java | 7 +-
.../test_common/openmldb/SDKClient.java | 8 +-
.../restful/common/OpenMLDBHttp.java | 25 +++
.../test_common/restful/model/HttpData.java | 14 ++
.../test_common/util/HttpRequest.java | 44 ++--
.../openmldb/test_common/util/SDKUtil.java | 8 +-
.../openmldb/test_common/util/Tool.java | 4 -
test/steps/build-java-sdk.sh | 2 +-
test/steps/format_config.sh | 2 +-
test/steps/openmldb-apiserver-test.sh | 1 -
test/steps/openmldb-integration-test.sh | 59 +++++
test/steps/openmldb-sdk-test-java-src.sh | 6 +-
53 files changed, 1312 insertions(+), 474 deletions(-)
create mode 100644 test/integration-test/README
create mode 100755 test/integration-test/openmldb-test-java/kafka_test.sh
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/executor/RestfulOnlineExecutor.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/util/HttpUtil.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/util/RowsSort.java
rename test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/{v030/TestDeployment.java => tmp/TestCluster.java} (52%)
delete mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestDropTable.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestExpression.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestFunction.java
rename test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/{v040/TestDeployment.java => tmp/TestIndexOptimized.java} (54%)
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestJoin.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestLongWindow.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestMultiDB.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/tmp/TestSelect.java
rename test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/{v230/TestInsert.java => tmp/TestTmp.java} (53%)
delete mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/v230/TestProcedure.java
delete mode 100644 test/integration-test/openmldb-test-java/openmldb-http-test/src/test/java/com/_4paradigm/openmldb/http_test/v230/TestShow.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-test-common/src/main/java/com/_4paradigm/openmldb/test_common/common/BaseExecutor.java
create mode 100644 test/integration-test/openmldb-test-java/openmldb-test-common/src/main/java/com/_4paradigm/openmldb/test_common/restful/model/HttpData.java
create mode 100755 test/steps/openmldb-integration-test.sh
diff --git a/.github/workflows/integration-test-src.yml b/.github/workflows/integration-test-src.yml
index 62d35ea6e28..d6fd1cfa526 100644
--- a/.github/workflows/integration-test-src.yml
+++ b/.github/workflows/integration-test-src.yml
@@ -104,7 +104,6 @@ jobs:
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
to: ${{ secrets.MAIL_TO }}
from: GitHub Actions
- content_type: text/plain
attachments: surefire-reports.tar.gz
java-sdk-cluster-memory-task:
@@ -148,7 +147,6 @@ jobs:
html_body: file://test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
to: ${{ secrets.MAIL_TO }}
from: GitHub Actions
- content_type: text/plain
attachments: surefire-reports.tar.gz
java-sdk-cluster-memory-1:
@@ -191,7 +189,6 @@ jobs:
body: OpenMLDB Memory 1 Test Failed
to: ${{ secrets.MAIL_TO }}
from: GitHub Actions
- content_type: text/plain
attachments: surefire-reports.tar.gz
java-sdk-cluster-ssd-0:
@@ -234,7 +231,6 @@ jobs:
body: OpenMLDB SSD Test Failed
to: ${{ secrets.MAIL_TO }}
from: GitHub Actions
- content_type: text/plain
attachments: surefire-reports.tar.gz
# java-sdk-cluster-ssd-task:
@@ -320,7 +316,6 @@ jobs:
body: OpenMLDB HDD Test Failed
to: ${{ secrets.MAIL_TO }}
from: GitHub Actions
- content_type: text/plain
attachments: surefire-reports.tar.gz
# java-sdk-cluster-hdd-task:
@@ -568,5 +563,4 @@ jobs:
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
to: ${{ secrets.MAIL_TO }}
from: GitHub Actions
- content_type: text/plain
attachments: surefire-reports.tar.gz
diff --git a/.github/workflows/selfhost_intergration.yml b/.github/workflows/selfhost_intergration.yml
index dcaf34cce8d..e1695f20b4f 100644
--- a/.github/workflows/selfhost_intergration.yml
+++ b/.github/workflows/selfhost_intergration.yml
@@ -38,6 +38,9 @@ jobs:
make SQL_JAVASDK_ENABLE=ON && make SQL_JAVASDK_ENABLE=ON install
mv openmldb-linux openmldb-main-linux
tar -zcf openmldb-linux.tar.gz openmldb-main-linux
+ mv java/openmldb-batch/target/openmldb*-SNAPSHOT.jar openmldb-batch.jar
+ mv java/openmldb-jdbc/target/openmldb*-SNAPSHOT.jar openmldb-jdbc.jar
+ mv java/openmldb-native/target/openmldb*-SNAPSHOT.jar openmldb-native.jar
- name: download
if: ${{ env.E_VERSION != 'main' }}
run: |
@@ -48,9 +51,64 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: openmldb-package
- path: openmldb-linux.tar.gz
+ path: |
+ openmldb-batch.jar
+ openmldb-jdbc.jar
+ openmldb-native.jar
+ openmldb-linux.tar.gz
-
+ apiserver-cluster:
+ needs: build-openmldb
+
+ runs-on: [self-hosted,common-user]
+ steps:
+ - uses: actions/checkout@v3
+ - name: before test
+ if: ${{ env.ETYPE == 'all' || env.ETYPE == 'java' }}
+ run: mkdir ${{ github.job }}
+ - name: download artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: openmldb-package
+ - name: install openmldb
+ run: |
+ tar -zxf openmldb-linux.tar.gz -C ${{ github.job }}/
+ bash test/steps/format_config.sh $(pwd)/${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux ${{ github.job }} 20001 21000 java
+ bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
+ bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
+ - name: test
+ run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -d deploy -m apiserver
+ - name: stop openmldb
+ if: always()
+ run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
+ - name: remove openmldb
+ if: always()
+ run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
+ - name: TEST Results
+ if: always()
+ uses: EnricoMi/publish-unit-test-result-action@v1
+ with:
+ files: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/TEST-*.xml
+ check_name: "SRC apiserver-cluster Report"
+ comment_title: "SRC apiserver-cluster Report"
+ - name: tar test report
+ if: ${{ failure() }}
+ run: tar -zcvf surefire-reports.tar.gz test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports
+ - name: Send Email
+ if: ${{ failure() }}
+ uses: dawidd6/action-send-mail@master
+ with:
+ server_address: mail.4paradigm.com
+ server_port: 995
+ username: ${{ secrets.MAIL_USERNAME }}
+ password: ${{ secrets.MAIL_PASSWORD }}
+ secure: true
+ subject: OpenMLDB Memory Test
+ body: OpenMLDB Memory Test Failed
+ html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
+ to: ${{ secrets.MAIL_TO }}
+ from: GitHub Actions
+ attachments: surefire-reports.tar.gz
java-sdk-cluster-memory-0:
needs: build-openmldb
@@ -72,16 +130,12 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
- run: |
- mkdir mvnrepo
- export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/mvnrepo"
- echo $MAVEN_OPTS
- bash test/steps/openmldb-sdk-test-java-src.sh -c test_cluster.xml -d deploy -l "0" -s "memory"
+ run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster.xml -d deploy -l "0" -s "memory"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
- name: remove openmldb
- if: success()
+ if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
- name: TEST Results
if: always()
@@ -97,10 +151,11 @@ jobs:
if: ${{ failure() }}
uses: dawidd6/action-send-mail@master
with:
- server_address: smtp.partner.outlook.cn
- server_port: 587
+ server_address: mail.4paradigm.com
+ server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
+ secure: true
subject: OpenMLDB Memory Test
body: OpenMLDB Memory Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
@@ -129,16 +184,12 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
- run: |
- mkdir mvnrepo
- export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/mvnrepo"
- echo $MAVEN_OPTS
- bash test/steps/openmldb-sdk-test-java-src.sh -c test_cluster.xml -d deploy -l "1,2,3,4,5" -s "memory"
+ run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster.xml -d deploy -l "1,2,3,4,5" -s "memory"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
- name: remove openmldb
- if: success()
+ if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
- name: TEST Results
if: always()
@@ -154,10 +205,11 @@ jobs:
if: ${{ failure() }}
uses: dawidd6/action-send-mail@master
with:
- server_address: smtp.partner.outlook.cn
- server_port: 587
+ server_address: mail.4paradigm.com
+ server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
+ secure: true
subject: OpenMLDB Memory Test
body: OpenMLDB Memory Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
@@ -187,16 +239,12 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
- run: |
- mkdir mvnrepo
- export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/mvnrepo"
- echo $MAVEN_OPTS
- bash test/steps/openmldb-sdk-test-java-src.sh -c test_cluster_disk.xml -d deploy -l "0" -s "hdd"
+ run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster_disk.xml -d deploy -l "0" -s "hdd"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
- name: remove openmldb
- if: success()
+ if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
- name: TEST Results
if: always()
@@ -212,10 +260,11 @@ jobs:
if: ${{ failure() }}
uses: dawidd6/action-send-mail@master
with:
- server_address: smtp.partner.outlook.cn
- server_port: 587
+ server_address: mail.4paradigm.com
+ server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
+ secure: true
subject: OpenMLDB HDD Test
body: OpenMLDB HDD Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
@@ -240,20 +289,16 @@ jobs:
- name: install openmldb
run: |
tar -zxf openmldb-linux.tar.gz -C ${{ github.job }}/
- bash test/steps/format_config.sh $(pwd)/${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux java-sdk-cluster-memory-0 23001 24000 java ssd
+ bash test/steps/format_config.sh $(pwd)/${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux ${{ github.job }} 23001 24000 java ssd
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
- run: |
- mkdir mvnrepo
- export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/mvnrepo"
- echo $MAVEN_OPTS
- bash test/steps/openmldb-sdk-test-java-src.sh -c test_cluster_disk.xml -d deploy -l "0" -s "ssd"
+ run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster_disk.xml -d deploy -l "0" -s "ssd"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
- name: remove openmldb
- if: success()
+ if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
- name: TEST Results
if: always()
@@ -269,10 +314,11 @@ jobs:
if: ${{ failure() }}
uses: dawidd6/action-send-mail@master
with:
- server_address: smtp.partner.outlook.cn
- server_port: 587
+ server_address: mail.4paradigm.com
+ server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
+ secure: true
subject: OpenMLDB SSD Test
body: OpenMLDB SSD Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
@@ -299,19 +345,15 @@ jobs:
bash test/steps/format_config.sh $(pwd)/${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux ${{ github.job }} 24001 25000 java hadoop
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanager.sh
- bash HADOOP_CONF_DIR=/mnt/hdd0/denglong/openmldb_runner_work/hadoop ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanager.sh
+ bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanagers.sh
+ HADOOP_CONF_DIR=/mnt/hdd0/denglong/openmldb_runner_work/hadoop ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanagers.sh
- name: test
- run: |
- mkdir mvnrepo
- export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/mvnrepo"
- echo $MAVEN_OPTS
- bash test/steps/openmldb-sdk-test-java-src.sh -c test_yarn.xml -d deploy -l "0" -s "memory"
+ run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_yarn.xml -d deploy -l "0" -s "memory"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
- name: remove openmldb
- if: success()
+ if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
- name: TEST Results
if: always()
@@ -327,10 +369,11 @@ jobs:
if: ${{ failure() }}
uses: dawidd6/action-send-mail@master
with:
- server_address: smtp.partner.outlook.cn
- server_port: 587
+ server_address: mail.4paradigm.com
+ server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
+ secure: true
subject: OpenMLDB yarn Test
body: OpenMLDB yarn Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
@@ -359,15 +402,12 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
- run: |
- mkdir mvnrepo
- export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/mvnrepo"
- echo $MAVEN_OPTS
+ run: echo "a"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
- name: remove openmldb
- if: success()
+ if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/clear-all.sh
# - name: TEST Results
# if: always()
@@ -383,8 +423,9 @@ jobs:
# if: ${{ failure() }}
# uses: dawidd6/action-send-mail@master
# with:
- # server_address: smtp.partner.outlook.cn
- # server_port: 587
+ # server_address: mail.4paradigm.com
+ # server_port: 995
+ # secure: true
# username: ${{ secrets.MAIL_USERNAME }}
# password: ${{ secrets.MAIL_PASSWORD }}
# subject: OpenMLDB yarn Test
diff --git a/cases/integration_test/cluster/window_and_lastjoin.yaml b/cases/integration_test/cluster/window_and_lastjoin.yaml
index 1d629fbe1b1..45cc9599e78 100644
--- a/cases/integration_test/cluster/window_and_lastjoin.yaml
+++ b/cases/integration_test/cluster/window_and_lastjoin.yaml
@@ -217,16 +217,16 @@ cases:
columns : ["id int", "c1 string", "c2 string", "c3 string", "c4 string", "c6 double", "c7 timestamp"]
indexs: ["index1:c1:c7", "index2:c2:c7", "index3:c3:c7", "index4:c4:c7"]
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000]
- - [ 2, "a", "aa", "aaa", "aaaa", "1.0", 1590738991000]
- - [ 3, "a", "aa", "aaa", "bbbb", "1.0", 1590738992000]
- - [ 4, "a", "aa", "aaa", "bbbb", "1.0", 1590738993000]
- - [ 5, "a", "aa", "bbb", "bbbb", "1.0", 1590738994000]
- - [ 6, "a", "aa", "bbb", "bbbb", "1.0", 1590738995000]
- - [ 7, "a", "bb", "bbb", "bbbb", "1.0", 1590738996000 ]
- - [ 8, "a", "bb", "bbb", "bbbb", "1.0", 1590738997000 ]
- - [ 9, "b", "bb", "bbb", "bbbb", "1.0", 1590739998000 ]
- - [10, "b", "bb", "bbb", "bbbb", "1.0", 1590739999000 ]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000]
+ - [ 2, "a", "aa", "aaa", "aaaa", 1.0, 1590738991000]
+ - [ 3, "a", "aa", "aaa", "bbbb", 1.0, 1590738992000]
+ - [ 4, "a", "aa", "aaa", "bbbb", 1.0, 1590738993000]
+ - [ 5, "a", "aa", "bbb", "bbbb", 1.0, 1590738994000]
+ - [ 6, "a", "aa", "bbb", "bbbb", 1.0, 1590738995000]
+ - [ 7, "a", "bb", "bbb", "bbbb", 1.0, 1590738996000 ]
+ - [ 8, "a", "bb", "bbb", "bbbb", 1.0, 1590738997000 ]
+ - [ 9, "b", "bb", "bbb", "bbbb", 1.0, 1590739998000 ]
+ - [10, "b", "bb", "bbb", "bbbb", 1.0, 1590739999000 ]
sql: |
select * from
(
@@ -270,16 +270,16 @@ cases:
columns : ["id int", "c1 string", "c2 string", "c3 string", "c4 string", "c6 double", "c7 timestamp"]
indexs: ["index1:c1:c7", "index2:c2:c7", "index3:c3:c7", "index4:c4:c7"]
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000]
- - [ 2, "a", "aa", "aaa", "aaaa", "1.0", 1590738991000]
- - [ 3, "a", "aa", "aaa", "bbbb", "1.0", 1590738992000]
- - [ 4, "a", "aa", "aaa", "bbbb", "1.0", 1590738993000]
- - [ 5, "a", "aa", "bbb", "bbbb", "1.0", 1590738994000]
- - [ 6, "a", "aa", "bbb", "bbbb", "1.0", 1590738995000]
- - [ 7, "a", "bb", "bbb", "bbbb", "1.0", 1590738996000 ]
- - [ 8, "a", "bb", "bbb", "bbbb", "1.0", 1590738997000 ]
- - [ 9, "b", "bb", "bbb", "bbbb", "1.0", 1590739998000 ]
- - [10, "b", "bb", "bbb", "bbbb", "1.0", 1590739999000 ]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000]
+ - [ 2, "a", "aa", "aaa", "aaaa", 1.0, 1590738991000]
+ - [ 3, "a", "aa", "aaa", "bbbb", 1.0, 1590738992000]
+ - [ 4, "a", "aa", "aaa", "bbbb", 1.0, 1590738993000]
+ - [ 5, "a", "aa", "bbb", "bbbb", 1.0, 1590738994000]
+ - [ 6, "a", "aa", "bbb", "bbbb", 1.0, 1590738995000]
+ - [ 7, "a", "bb", "bbb", "bbbb", 1.0, 1590738996000 ]
+ - [ 8, "a", "bb", "bbb", "bbbb", 1.0, 1590738997000 ]
+ - [ 9, "b", "bb", "bbb", "bbbb", 1.0, 1590739998000 ]
+ - [10, "b", "bb", "bbb", "bbbb", 1.0, 1590739999000 ]
sql: |
select * from
(
@@ -299,7 +299,7 @@ cases:
window w4 as (PARTITION BY {0}.c4 ORDER BY {0}.c7 ROWS_RANGE BETWEEN 10d PRECEDING AND CURRENT ROW)
) as out4 on out1_id=out4_id;
request_plan: |
- SIMPLE_PROJECT(sources=(out1_id, c1, w1_sum_c6, out2_id, c2, w2_sum_c6, out3_id, c3, w3_sum_c6, out4.out4_id, out4.c4, out4.w4_sum_c6))
+ SIMPLE_PROJECT(sources=(out1.out1_id, out1.c1, out1.w1_sum_c6, out2.out2_id, out2.c2, out2.w2_sum_c6, out3.out3_id, out3.c3, out3.w3_sum_c6, out4.out4_id, out4.c4, out4.w4_sum_c6))
REQUEST_JOIN(type=LastJoin, condition=, left_keys=(out1_id), right_keys=(out4_id), index_keys=)
REQUEST_JOIN(type=LastJoin, condition=, left_keys=(out1_id), right_keys=(out3_id), index_keys=)
REQUEST_JOIN(type=LastJoin, condition=, left_keys=(out1_id), right_keys=(out2_id), index_keys=)
@@ -325,7 +325,7 @@ cases:
DATA_PROVIDER(type=Partition, table=auto_t0, index=index4)
cluster_request_plan: |
- SIMPLE_PROJECT(sources=(out1_id, c1, w1_sum_c6, out2_id, c2, w2_sum_c6, out3_id, c3, w3_sum_c6, out4.out4_id, out4.c4, out4.w4_sum_c6))
+ SIMPLE_PROJECT(sources=(out1.out1_id, out1.c1, out1.w1_sum_c6, out2.out2_id, out2.c2, out2.w2_sum_c6, out3.out3_id, out3.c3, out3.w3_sum_c6, out4.out4_id, out4.c4, out4.w4_sum_c6))
REQUEST_JOIN(type=LastJoin, condition=, left_keys=(out1_id), right_keys=(out4_id), index_keys=)
REQUEST_JOIN(type=LastJoin, condition=, left_keys=(out1_id), right_keys=(out3_id), index_keys=)
REQUEST_JOIN(type=LastJoin, condition=, left_keys=(out1_id), right_keys=(out2_id), index_keys=)
@@ -391,29 +391,29 @@ cases:
columns : ["id int", "c1 string", "c2 string", "c3 string", "c4 string", "c6 double", "c7 timestamp"]
indexs: ["index1:c1:c7"]
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000]
- - [ 2, "a", "aa", "aaa", "aaaa", "2.0", 1590738991000]
- - [ 3, "a", "aa", "aaa", "bbbb", "3.0", 1590738992000]
- - [ 4, "a", "aa", "aaa", "bbbb", "4.0", 1590738993000]
- - [ 5, "a", "aa", "bbb", "bbbb", "5.0", 1590738994000]
- - [ 6, "a", "aa", "bbb", "bbbb", "6.0", 1590738995000]
- - [ 7, "a", "bb", "bbb", "bbbb", "7.0", 1590738996000 ]
- - [ 8, "a", "bb", "bbb", "bbbb", "8.0", 1590738997000 ]
- - [ 9, "b", "bb", "bbb", "bbbb", "9.0", 1590738998000 ]
- - [10, "b", "bb", "bbb", "bbbb", "10.0", 1590738999000 ]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000]
+ - [ 2, "a", "aa", "aaa", "aaaa", 2.0, 1590738991000]
+ - [ 3, "a", "aa", "aaa", "bbbb", 3.0, 1590738992000]
+ - [ 4, "a", "aa", "aaa", "bbbb", 4.0, 1590738993000]
+ - [ 5, "a", "aa", "bbb", "bbbb", 5.0, 1590738994000]
+ - [ 6, "a", "aa", "bbb", "bbbb", 6.0, 1590738995000]
+ - [ 7, "a", "bb", "bbb", "bbbb", 7.0, 1590738996000 ]
+ - [ 8, "a", "bb", "bbb", "bbbb", 8.0, 1590738997000 ]
+ - [ 9, "b", "bb", "bbb", "bbbb", 9.0, 1590738998000 ]
+ - [10, "b", "bb", "bbb", "bbbb", 10.0, 1590738999000 ]
- columns: ["rid int", "x1 string", "x2 string", "x3 string", "x4 string", "x6 double", "x7 timestamp"]
indexs: ["index1:x1:x7", "index2:x2:x7", "index3:x3:x7", "index4:x4:x7", ]
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000 ]
- - [ 2, "a", "aa", "aaa", "aaaa", "1.0", 1590738991000 ]
- - [ 3, "a", "aa", "aaa", "bbbb", "1.0", 1590738992000 ]
- - [ 4, "a", "aa", "aaa", "bbbb", "1.0", 1590738993000 ]
- - [ 5, "a", "aa", "bbb", "bbbb", "1.0", 1590738994000 ]
- - [ 6, "a", "aa", "bbb", "bbbb", "1.0", 1590738995000 ]
- - [ 7, "a", "bb", "bbb", "bbbb", "1.0", 1590738996000 ]
- - [ 8, "a", "bb", "bbb", "bbbb", "1.0", 1590738997000 ]
- - [ 9, "b", "bb", "bbb", "bbbb", "1.0", 1590738998000 ]
- - [ 10, "b", "bb", "bbb", "bbbb", "1.0",1590738999000 ]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000 ]
+ - [ 2, "a", "aa", "aaa", "aaaa", 1.0, 1590738991000 ]
+ - [ 3, "a", "aa", "aaa", "bbbb", 1.0, 1590738992000 ]
+ - [ 4, "a", "aa", "aaa", "bbbb", 1.0, 1590738993000 ]
+ - [ 5, "a", "aa", "bbb", "bbbb", 1.0, 1590738994000 ]
+ - [ 6, "a", "aa", "bbb", "bbbb", 1.0, 1590738995000 ]
+ - [ 7, "a", "bb", "bbb", "bbbb", 1.0, 1590738996000 ]
+ - [ 8, "a", "bb", "bbb", "bbbb", 1.0, 1590738997000 ]
+ - [ 9, "b", "bb", "bbb", "bbbb", 1.0, 1590738998000 ]
+ - [ 10, "b", "bb", "bbb", "bbbb", 1.0,1590738999000 ]
sql: |
select id, c1, c2, c3, c4, c6, c7, cur_hour, today
, w1_sum_c6, w1_max_c6, w1_min_c6, w1_avg_c6, w1_cnt_c6
@@ -493,16 +493,16 @@ cases:
"t1_rid int32", "t2_rid int32", "t3_rid int32", "t4_rid int32"]
order: id
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000, 15, 29, 1.0, 1.0, 1.0, 1.0, 1, NULL, NULL, NULL, NULL]
- - [ 2, "a", "aa", "aaa", "aaaa", "2.0", 1590738991000, 15, 29, 3.0, 2.0, 1.0, 1.5, 2, 1, NULL, NULL, NULL ]
- - [ 3, "a", "aa", "aaa", "bbbb", "3.0", 1590738992000, 15, 29, 6.0, 3.0, 1.0, 2.0, 3, 2 , 1, NULL, NULL]
- - [ 4, "a", "aa", "aaa", "bbbb", "4.0", 1590738993000, 15, 29, 10.0, 4.0, 1.0, 2.5, 4, 3 , 2, 1, NULL]
- - [ 5, "a", "aa", "bbb", "bbbb", "5.0", 1590738994000, 15, 29, 15.0, 5.0, 1.0, 3.0, 5, 4 , 3, NULL, NULL]
- - [ 6, "a", "aa", "bbb", "bbbb", "6.0", 1590738995000, 15, 29, 21.0, 6.0, 1.0, 3.5, 6, 5 , 4, NULL, NULL]
- - [ 7, "a", "bb", "bbb", "bbbb", "7.0", 1590738996000, 15, 29, 28.0, 7.0, 1.0, 4.0, 7, 6 , NULL, NULL, 3]
- - [ 8, "a", "bb", "bbb", "bbbb", "8.0", 1590738997000, 15, 29, 36.0, 8.0, 1.0, 4.5, 8, 7 , NULL, 5, 4]
- - [ 9, "b", "bb", "bbb", "bbbb", "9.0", 1590738998000, 15, 29, 9.0, 9.0, 9.0, 9.0, 1, NULL , 7, 6, 5]
- - [ 10, "b", "bb", "bbb", "bbbb", "10.0",1590738999000,15, 29, 19.0, 10.0, 9.0, 9.5, 2, 9, 8, 7, 6]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000, 15, 29, 1.0, 1.0, 1.0, 1.0, 1, NULL, NULL, NULL, NULL]
+ - [ 2, "a", "aa", "aaa", "aaaa", 2.0, 1590738991000, 15, 29, 3.0, 2.0, 1.0, 1.5, 2, 1, NULL, NULL, NULL ]
+ - [ 3, "a", "aa", "aaa", "bbbb", 3.0, 1590738992000, 15, 29, 6.0, 3.0, 1.0, 2.0, 3, 2 , 1, NULL, NULL]
+ - [ 4, "a", "aa", "aaa", "bbbb", 4.0, 1590738993000, 15, 29, 10.0, 4.0, 1.0, 2.5, 4, 3 , 2, 1, NULL]
+ - [ 5, "a", "aa", "bbb", "bbbb", 5.0, 1590738994000, 15, 29, 15.0, 5.0, 1.0, 3.0, 5, 4 , 3, NULL, NULL]
+ - [ 6, "a", "aa", "bbb", "bbbb", 6.0, 1590738995000, 15, 29, 21.0, 6.0, 1.0, 3.5, 6, 5 , 4, NULL, NULL]
+ - [ 7, "a", "bb", "bbb", "bbbb", 7.0, 1590738996000, 15, 29, 28.0, 7.0, 1.0, 4.0, 7, 6 , NULL, NULL, 3]
+ - [ 8, "a", "bb", "bbb", "bbbb", 8.0, 1590738997000, 15, 29, 36.0, 8.0, 1.0, 4.5, 8, 7 , NULL, 5, 4]
+ - [ 9, "b", "bb", "bbb", "bbbb", 9.0, 1590738998000, 15, 29, 9.0, 9.0, 9.0, 9.0, 1, NULL , 7, 6, 5]
+ - [ 10, "b", "bb", "bbb", "bbbb", 10.0,1590738999000,15, 29, 19.0, 10.0, 9.0, 9.5, 2, 9, 8, 7, 6]
-
@@ -514,29 +514,29 @@ cases:
columns : ["id int", "c1 string", "c2 string", "c3 string", "c4 string", "c6 double", "c7 timestamp"]
indexs: ["index1:c1:c7"]
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000]
- - [ 2, "a", "aa", "aaa", "aaaa", "2.0", 1590738991000]
- - [ 3, "a", "aa", "aaa", "bbbb", "3.0", 1590738992000]
- - [ 4, "a", "aa", "aaa", "bbbb", "4.0", 1590738993000]
- - [ 5, "a", "aa", "bbb", "bbbb", "5.0", 1590738994000]
- - [ 6, "a", "aa", "bbb", "bbbb", "6.0", 1590738995000]
- - [ 7, "a", "bb", "bbb", "bbbb", "7.0", 1590738996000 ]
- - [ 8, "a", "bb", "bbb", "bbbb", "8.0", 1590738997000 ]
- - [ 9, "b", "bb", "bbb", "bbbb", "9.0", 1590738998000 ]
- - [10, "b", "bb", "bbb", "bbbb", "10.0", 1590738999000 ]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000]
+ - [ 2, "a", "aa", "aaa", "aaaa", 2.0, 1590738991000]
+ - [ 3, "a", "aa", "aaa", "bbbb", 3.0, 1590738992000]
+ - [ 4, "a", "aa", "aaa", "bbbb", 4.0, 1590738993000]
+ - [ 5, "a", "aa", "bbb", "bbbb", 5.0, 1590738994000]
+ - [ 6, "a", "aa", "bbb", "bbbb", 6.0, 1590738995000]
+ - [ 7, "a", "bb", "bbb", "bbbb", 7.0, 1590738996000 ]
+ - [ 8, "a", "bb", "bbb", "bbbb", 8.0, 1590738997000 ]
+ - [ 9, "b", "bb", "bbb", "bbbb", 9.0, 1590738998000 ]
+ - [10, "b", "bb", "bbb", "bbbb", 10.0, 1590738999000 ]
- columns: ["rid int", "x1 string", "x2 string", "x3 string", "x4 string", "x6 double", "x7 timestamp"]
indexs: ["index1:x1:x7", "index2:x2:x7", "index3:x3:x7", "index4:x4:x7", ]
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000 ]
- - [ 2, "a", "aa", "aaa", "aaaa", "1.0", 1590738991000 ]
- - [ 3, "a", "aa", "aaa", "bbbb", "1.0", 1590738992000 ]
- - [ 4, "a", "aa", "aaa", "bbbb", "1.0", 1590738993000 ]
- - [ 5, "a", "aa", "bbb", "bbbb", "1.0", 1590738994000 ]
- - [ 6, "a", "aa", "bbb", "bbbb", "1.0", 1590738995000 ]
- - [ 7, "a", "bb", "bbb", "bbbb", "1.0", 1590738996000 ]
- - [ 8, "a", "bb", "bbb", "bbbb", "1.0", 1590738997000 ]
- - [ 9, "b", "bb", "bbb", "bbbb", "1.0", 1590738998000 ]
- - [ 10, "b", "bb", "bbb", "bbbb", "1.0",1590738999000 ]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000 ]
+ - [ 2, "a", "aa", "aaa", "aaaa", 1.0, 1590738991000 ]
+ - [ 3, "a", "aa", "aaa", "bbbb", 1.0, 1590738992000 ]
+ - [ 4, "a", "aa", "aaa", "bbbb", 1.0, 1590738993000 ]
+ - [ 5, "a", "aa", "bbb", "bbbb", 1.0, 1590738994000 ]
+ - [ 6, "a", "aa", "bbb", "bbbb", 1.0, 1590738995000 ]
+ - [ 7, "a", "bb", "bbb", "bbbb", 1.0, 1590738996000 ]
+ - [ 8, "a", "bb", "bbb", "bbbb", 1.0, 1590738997000 ]
+ - [ 9, "b", "bb", "bbb", "bbbb", 1.0, 1590738998000 ]
+ - [ 10, "b", "bb", "bbb", "bbbb", 1.0,1590738999000 ]
sql: |
select id, c1, c2, c3, c4, c6, c7, cur_hour, today
, w1_sum_c6, w1_max_c6, w1_min_c6, w1_avg_c6, w1_cnt_c6
@@ -616,13 +616,13 @@ cases:
"t1_rid int32", "t2_rid int32", "t3_rid int32", "t4_rid int32"]
order: id
rows:
- - [ 1, "a", "aa", "aaa", "aaaa", "1.0", 1590738990000, 15, 29, 1.0, 1.0, 1.0, 1.0, 1, NULL, NULL, NULL, NULL]
- - [ 2, "a", "aa", "aaa", "aaaa", "2.0", 1590738991000, 15, 29, 3.0, 2.0, 1.0, 1.5, 2, 1, NULL, NULL, NULL ]
- - [ 3, "a", "aa", "aaa", "bbbb", "3.0", 1590738992000, 15, 29, 6.0, 3.0, 1.0, 2.0, 3, 2 , 1, NULL, NULL]
- - [ 4, "a", "aa", "aaa", "bbbb", "4.0", 1590738993000, 15, 29, 10.0, 4.0, 1.0, 2.5, 4, 3 , 2, 1, NULL]
- - [ 5, "a", "aa", "bbb", "bbbb", "5.0", 1590738994000, 15, 29, 15.0, 5.0, 1.0, 3.0, 5, 4 , 3, NULL, NULL]
- - [ 6, "a", "aa", "bbb", "bbbb", "6.0", 1590738995000, 15, 29, 21.0, 6.0, 1.0, 3.5, 6, 5 , 4, NULL, NULL]
- - [ 7, "a", "bb", "bbb", "bbbb", "7.0", 1590738996000, 15, 29, 28.0, 7.0, 1.0, 4.0, 7, 6 , NULL, NULL, 3]
- - [ 8, "a", "bb", "bbb", "bbbb", "8.0", 1590738997000, 15, 29, 36.0, 8.0, 1.0, 4.5, 8, 7 , NULL, 5, 4]
- - [ 9, "b", "bb", "bbb", "bbbb", "9.0", 1590738998000, 15, 29, 9.0, 9.0, 9.0, 9.0, 1, NULL , 7, 6, 5]
- - [ 10, "b", "bb", "bbb", "bbbb", "10.0",1590738999000,15, 29, 19.0, 10.0, 9.0, 9.5, 2, 9, 8, 7, 6]
+ - [ 1, "a", "aa", "aaa", "aaaa", 1.0, 1590738990000, 15, 29, 1.0, 1.0, 1.0, 1.0, 1, NULL, NULL, NULL, NULL]
+ - [ 2, "a", "aa", "aaa", "aaaa", 2.0, 1590738991000, 15, 29, 3.0, 2.0, 1.0, 1.5, 2, 1, NULL, NULL, NULL ]
+ - [ 3, "a", "aa", "aaa", "bbbb", 3.0, 1590738992000, 15, 29, 6.0, 3.0, 1.0, 2.0, 3, 2 , 1, NULL, NULL]
+ - [ 4, "a", "aa", "aaa", "bbbb", 4.0, 1590738993000, 15, 29, 10.0, 4.0, 1.0, 2.5, 4, 3 , 2, 1, NULL]
+ - [ 5, "a", "aa", "bbb", "bbbb", 5.0, 1590738994000, 15, 29, 15.0, 5.0, 1.0, 3.0, 5, 4 , 3, NULL, NULL]
+ - [ 6, "a", "aa", "bbb", "bbbb", 6.0, 1590738995000, 15, 29, 21.0, 6.0, 1.0, 3.5, 6, 5 , 4, NULL, NULL]
+ - [ 7, "a", "bb", "bbb", "bbbb", 7.0, 1590738996000, 15, 29, 28.0, 7.0, 1.0, 4.0, 7, 6 , NULL, NULL, 3]
+ - [ 8, "a", "bb", "bbb", "bbbb", 8.0, 1590738997000, 15, 29, 36.0, 8.0, 1.0, 4.5, 8, 7 , NULL, 5, 4]
+ - [ 9, "b", "bb", "bbb", "bbbb", 9.0, 1590738998000, 15, 29, 9.0, 9.0, 9.0, 9.0, 1, NULL , 7, 6, 5]
+ - [ 10, "b", "bb", "bbb", "bbbb", 10.0,1590738999000,15, 29, 19.0, 10.0, 9.0, 9.5, 2, 9, 8, 7, 6]
diff --git a/cases/integration_test/expression/test_type.yaml b/cases/integration_test/expression/test_type.yaml
index 295ba024323..9def66de50a 100644
--- a/cases/integration_test/expression/test_type.yaml
+++ b/cases/integration_test/expression/test_type.yaml
@@ -83,10 +83,8 @@ cases:
sql: select cast(c9 as bool) as b1,cast(c2 as smallint) as b2,cast(c3 as int) as b3,cast(c4 as bigint) as b4,cast(c5 as float) as b5,cast(c6 as double) as b6,cast(c7 as timestamp) as b7,cast(c8 as date) as b8,cast(c1 as string) as b9 from {0};
expect:
columns: ["b1 bool","b2 smallint","b3 int","b4 bigint","b5 float","b6 double","b7 timestamp","b8 date","b9 string"]
- expectProvider:
- 0:
- rows:
- - [false,30,30,30,30.0,30.0,1590738989000,"2020-05-01",aa]
+ rows:
+ - [false,30,30,30,30.0,30.0,null,"2020-05-01",aa]
- id: 3
desc: "cast_date_正确"
# tags: ["TODO","本地成功,CICD失败,原因待定位"]
diff --git a/cases/integration_test/function/test_udaf_function.yaml b/cases/integration_test/function/test_udaf_function.yaml
index 13cf41d9e43..70e49da5905 100644
--- a/cases/integration_test/function/test_udaf_function.yaml
+++ b/cases/integration_test/function/test_udaf_function.yaml
@@ -2401,15 +2401,15 @@ cases:
- columns: [ "id int","ts timestamp","group1 string","val1 int" ]
indexs: [ "index1:group1:ts" ]
name: t1
- data: |
- 1, 1612130400000, g1, 1
- 2, 1612130401000, g1, 2
- 3, 1612130402000, g1, 3
- 4, 1612130403000, g1, 4
- 5, 1612130404000, g1, 5
- 6, 1612130404000, g2, 4
- 7, 1612130405000, g2, 3
- 8, 1612130406000, g2, 2
+ rows:
+ - [1, 1612130400000, g1, 1]
+ - [2, 1612130401000, g1, 2]
+ - [3, 1612130402000, g1, 3]
+ - [4, 1612130403000, g1, 4]
+ - [5, 1612130404000, g1, 5]
+ - [6, 1612130404000, g2, 4]
+ - [7, 1612130405000, g2, 3]
+ - [8, 1612130406000, g2, 2]
sql: |
select
`id`,
@@ -2440,15 +2440,15 @@ cases:
- columns: [ "id int","ts timestamp","group1 string","val1 int" ]
indexs: [ "index1:group1:ts" ]
name: t1
- data: |
- 1, 1612130400000, g1, 1
- 2, 1612130401000, g1, 2
- 3, 1612130402000, g1, 3
- 4, 1612130403000, g1, 4
- 5, 1612130404000, g1, 5
- 6, 1612130405000, g2, 4
- 7, 1612130406000, g2, 3
- 8, 1612130407000, g2, 2
+ rows:
+ - [1, 1612130400000, g1, 1]
+ - [2, 1612130401000, g1, 2]
+ - [3, 1612130402000, g1, 3]
+ - [4, 1612130403000, g1, 4]
+ - [5, 1612130404000, g1, 5]
+ - [6, 1612130405000, g2, 4]
+ - [7, 1612130406000, g2, 3]
+ - [8, 1612130407000, g2, 2]
sql: |
select
`id`,
@@ -2480,15 +2480,15 @@ cases:
- columns: [ "id int","ts timestamp","group1 string","val1 int" ]
indexs: [ "index1:group1:ts" ]
name: t1
- data: |
- 1, 1612130400000, g1, 1
- 2, 1612130401000, g1, 2
- 3, 1612130402000, g1, 3
- 4, 1612130403000, g1, 4
- 5, 1612130404000, g1, 5
- 6, 1612130405000, g2, 4
- 7, 1612130406000, g2, 3
- 8, 1612130407000, g2, 2
+ rows:
+ - [1, 1612130400000, g1, 1]
+ - [2, 1612130401000, g1, 2]
+ - [3, 1612130402000, g1, 3]
+ - [4, 1612130403000, g1, 4]
+ - [5, 1612130404000, g1, 5]
+ - [6, 1612130405000, g2, 4]
+ - [7, 1612130406000, g2, 3]
+ - [8, 1612130407000, g2, 2]
sql: |
select
`id`,
@@ -2519,15 +2519,15 @@ cases:
- columns: [ "id int","ts timestamp","group1 string","val1 int" ]
indexs: [ "index1:group1:ts" ]
name: t1
- data: |
- 1, 1612130400000, g1, 1
- 2, 1612130401000, g1, 2
- 3, 1612130402000, g1, 3
- 4, 1612130403000, g1, 4
- 5, 1612130404000, g1, 5
- 6, 1612130405000, g2, 4
- 7, 1612130406000, g2, 3
- 8, 1612130407000, g2, 2
+ rows:
+ - [1, 1612130400000, g1, 1]
+ - [2, 1612130401000, g1, 2]
+ - [3, 1612130402000, g1, 3]
+ - [4, 1612130403000, g1, 4]
+ - [5, 1612130404000, g1, 5]
+ - [ 6, 1612130405000, g2, 4]
+ - [7, 1612130406000, g2, 3]
+ - [8, 1612130407000, g2, 2]
sql: |
select
`id`,
diff --git a/cases/integration_test/join/test_lastjoin_simple.yaml b/cases/integration_test/join/test_lastjoin_simple.yaml
index fa58a927859..9795d4a0d70 100644
--- a/cases/integration_test/join/test_lastjoin_simple.yaml
+++ b/cases/integration_test/join/test_lastjoin_simple.yaml
@@ -123,7 +123,10 @@ cases:
- [ "cc",41,121,1590738991000 ]
sql: select {0}.c1,{0}.c2,{1}.c3,{1}.c4 from {0} last join {1} on {0}.c1={1}.c1;
expect:
- success: false
+ columns: [ "c1 string","c2 int","c3 bigint","c4 timestamp" ]
+ rows:
+ - [ "aa",2,13,1590738989000 ]
+ - [ "bb",21,131,1590738990000 ]
- id: 4-2
desc: Last Join 无order by, 部分拼表条件命中索引
inputs:
@@ -172,7 +175,12 @@ cases:
- [ "cc",41,121,1590738991000 ]
sql: select {0}.c1,{0}.c2,{1}.c3,{1}.c4 from {0} last join {1} on {0}.c1={1}.c1 and {0}.c4={1}.c4;
expect:
- success: false
+ columns: [ "c1 string","c2 int","c3 bigint","c4 timestamp" ]
+ rows:
+ - [ "aa",2,13,1590738989000 ]
+ - [ "aa",20,15,1590738991000 ]
+ - [ "bb",21,131,1590738990000 ]
+ - [ "dd",41,null,null ]
- id: 4-4
desc: Last Join 无order by, 拼表条件命中部分的组合索引(后缀索引)
mode: non-performance-sensitive-unsupport, offline-unsupport
@@ -194,7 +202,12 @@ cases:
- [ "cc",41,121,1590738991000 ]
sql: select {0}.c1,{0}.c2,{1}.c3,{1}.c4 from {0} last join {1} on {0}.c1={1}.c1 and {0}.c4={1}.c4;
expect:
- success: false
+ columns: [ "c1 string","c2 int","c3 bigint","c4 timestamp" ]
+ rows:
+ - [ "aa",2,13,1590738989000 ]
+ - [ "aa",20,15,1590738991000 ]
+ - [ "bb",21,131,1590738990000 ]
+ - [ "dd",41,null,null ]
- id: 4-5
desc: Last Join 无order by, 拼表条件命中索引, 副表多条命中
tags: [ "注意offline随机拼接最后一条,改变结果顺序可能导致Spark结果不符合预期" ]
diff --git a/cases/integration_test/long_window/test_long_window_batch.yaml b/cases/integration_test/long_window/test_long_window_batch.yaml
index 60c938490d4..497640b318f 100644
--- a/cases/integration_test/long_window/test_long_window_batch.yaml
+++ b/cases/integration_test/long_window/test_long_window_batch.yaml
@@ -19,6 +19,7 @@ cases:
-
id: 0
desc: options格式错误
+ mode: apiserver-unsupport
inputs:
-
columns : ["id int","c1 string","c3 int","c4 bigint","c5 float","c6 double","c7 timestamp","c8 date"]
diff --git a/cases/integration_test/window/error_window.yaml b/cases/integration_test/window/error_window.yaml
index ce2fc32983f..798c66673d2 100644
--- a/cases/integration_test/window/error_window.yaml
+++ b/cases/integration_test/window/error_window.yaml
@@ -26,7 +26,7 @@ cases:
sql: |
SELECT id, c1, c4, count(c4) OVER w1 as w1_c4_count FROM {0} WINDOW w1 AS (PARTITION BY {0}.c8 ROWS BETWEEN 2 PRECEDING AND CURRENT ROW);
expect:
- success: false
+ success: true
- id: 1
desc: no partition by
inputs:
diff --git a/extensions/airflow-provider-openmldb/tests/hooks/test_openmldb_api_hook.py b/extensions/airflow-provider-openmldb/tests/hooks/test_openmldb_api_hook.py
index 2dcd9f447f1..b3714ade402 100644
--- a/extensions/airflow-provider-openmldb/tests/hooks/test_openmldb_api_hook.py
+++ b/extensions/airflow-provider-openmldb/tests/hooks/test_openmldb_api_hook.py
@@ -120,7 +120,7 @@ def test_query_api_server_without_data(self):
# no data
response = hook.run()
res = json.loads(response.text)
- assert res == {'code': -1, 'msg': 'Json parse failed'}
+ assert res == {'code': -1, 'msg': 'Request body json parse failed'}
def test_query_api_server_with_sql(self):
hook = OpenMLDBHook()
@@ -133,7 +133,7 @@ def test_query_api_server_without_mode(self):
response = hook.run(data='{"sql":"select 1"}')
res = json.loads(response.text)
assert res['code'] == -1
- assert res['msg'].startswith('Json parse failed')
+ assert res['msg'].startswith('Request body json parse failed')
def test_query_api_server(self):
hook = OpenMLDBHook()
diff --git a/test/integration-test/README b/test/integration-test/README
new file mode 100644
index 00000000000..1b250620412
--- /dev/null
+++ b/test/integration-test/README
@@ -0,0 +1,31 @@
+# README
+
+## 参数配置脚本
+
+```
+test/format_config.sh {openmldbPath} {jobName} {portFrom} {portTo} {type} {Dependency}
+```
+配置生成在 out/openmldb_info.yaml
+
+Dependency为hadoop时使用hadoop config
+
+Dependency为ssd时禁止部署在node-1
+
+## 一键运行脚本
+```
+test/openmldb-integration-test.sh -c {caseXML} -d {deployMode} -j {jarVersion} -l {caseLevel} -s {tableStorageMode} -m {executeMode}
+```
+
+### 版本兼容性测试
+openmldb包版本设置: test/format_config.sh {openmldbPath}
+
+jar版本设置: test/openmldb-integration-test.sh -j {jarVersion}
+
+### kafka测试
+```
+test/integration-test/openmldb-test-java/kafka_test.sh
+```
+环境配置于node-4: kakfa_test(docker)
+
+## 回归测试workflow
+hadoop配置文件位于 /mnt/hdd0/denglong/openmldb_runner_work/hadoop
\ No newline at end of file
diff --git a/test/integration-test/openmldb-test-java/kafka_test.sh b/test/integration-test/openmldb-test-java/kafka_test.sh
new file mode 100755
index 00000000000..ff585a4f93c
--- /dev/null
+++ b/test/integration-test/openmldb-test-java/kafka_test.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+
+apiserver="$(awk -F '"' 'NR==7{print $2}' ../../../out/openmldb_info.yaml)"
+zkc="zk=""$(awk -F '"' 'NR==2{print $2}' ../../../out/openmldb_info.yaml)"
+zkpath="\&zkPath=""$(awk -F '"' 'NR==3{print $2}' ../../../out/openmldb_info.yaml)"
+echo "${zkc}"
+echo "${zkpath}"
+zk="${zkc}""${zkpath}"
+
+docker exec -it kafka_test /start.sh "${zk}"
+sed -i "s#\"bootstrap.servers\":.*#\"bootstrap.servers\":node-4:9092,#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml
+sed -i "s#\"connect.listeners\":.*#\"connect.listeners\":http://node-4:8083,#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml
+sed -i "s#apiserver.address:.*#apiserver.address: ${apiserver}#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml
+sed -i "s#kafka_test?.*#kafka_test?${zk}\"#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml
+
+mvn test -pl openmldb-ecosystem
+
+docker exec -it kafka_test /stop.sh
diff --git a/test/integration-test/openmldb-test-java/openmldb-http-test/pom.xml b/test/integration-test/openmldb-test-java/openmldb-http-test/pom.xml
index 6a870c1d40d..bddd64a4c6a 100644
--- a/test/integration-test/openmldb-test-java/openmldb-http-test/pom.xml
+++ b/test/integration-test/openmldb-test-java/openmldb-http-test/pom.xml
@@ -24,6 +24,29 @@
openmldb-sdk-test
${project.version}
+
+ org.uncommons
+ reportng
+ 1.1.4
+ test
+
+
+ org.testng
+ testng
+
+
+
+
+ io.qameta.allure
+ allure-testng
+ 2.12.1
+
+
+ com.google.inject
+ guice
+ 4.0
+ test
+
@@ -31,10 +54,10 @@
org.apache.maven.plugins
maven-surefire-plugin
- 2.20.1
+ 2.22.1
false
- 1
+ 2
${suiteXmlFile}
@@ -44,20 +67,16 @@
target/
-
-
-
- org.aspectj
- aspectjweaver
- ${aspectj.version}
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.20.1
-
+
+
+ usedefaultlisteners
+ false
+
+
+ listener
+ org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter
+
+
caseName
@@ -98,6 +117,13 @@
+
+
+ org.aspectj
+ aspectjweaver
+ ${aspectj.version}
+
+
diff --git a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/check/DataChecker.java b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/check/DataChecker.java
index 0799e00e459..81098102ee9 100644
--- a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/check/DataChecker.java
+++ b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/check/DataChecker.java
@@ -35,7 +35,7 @@ public void check() throws Exception {
if(MapUtils.isEmpty(data)){
return ;
}
- String resultData = httpResult.getData();
+ String resultData = httpResult.getData().toString();
if(data.containsKey("code")){
Object expectCode = data.get("code");
Object actualCode = JsonPath.read(resultData, "$.code");
diff --git a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/common/ClusterTest.java b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/common/ClusterTest.java
index b24d2de1652..fe93d1ccb32 100644
--- a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/common/ClusterTest.java
+++ b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/common/ClusterTest.java
@@ -28,6 +28,8 @@
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
+import com._4paradigm.openmldb.test_common.provider.YamlUtil;
+import com._4paradigm.openmldb.test_common.util.Tool;
@Slf4j
public class ClusterTest extends BaseTest{
@@ -52,7 +54,9 @@ public void beforeTest(@Optional("qa") String env, @Optional("main") String vers
openMLDBDeploy.setOpenMLDBPath(openMLDBPath);
openMLDBDeploy.setCluster(false);
RestfulGlobalVar.mainInfo = openMLDBDeploy.deployCluster(2, 3);
- } else {
+ } else if(env.equalsIgnoreCase("deploy")){
+ RestfulGlobalVar.mainInfo = YamlUtil.getObject(Tool.openMLDBDir().getAbsolutePath()+"/out/openmldb_info.yaml",OpenMLDBInfo.class);
+ } else {
OpenMLDBInfo openMLDBInfo = new OpenMLDBInfo();
openMLDBInfo.setDeployType(OpenMLDBDeployType.CLUSTER);
openMLDBInfo.setNsNum(2);
diff --git a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/config/FedbRestfulConfig.java b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/config/FedbRestfulConfig.java
index ff216bf3a93..807efaf30b1 100644
--- a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/config/FedbRestfulConfig.java
+++ b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/config/FedbRestfulConfig.java
@@ -77,7 +77,8 @@ public class FedbRestfulConfig {
BASE_PATH = CONFIG.getProperty(RestfulGlobalVar.env + "_base_path");
// BASE_URL = CONFIG.getProperty(RestfulGlobalVar.env + "_base_url");
- DB_NAME = CONFIG.getProperty(RestfulGlobalVar.env + "_db_name");
+ // DB_NAME = CONFIG.getProperty(RestfulGlobalVar.env + "_db_name");
+ DB_NAME = "test_restful";
log.info("HybridSEConfig: db_name: {}", DB_NAME);
String versionStr = System.getProperty("fedbVersion");
if (StringUtils.isEmpty(versionStr)) {
diff --git a/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/executor/RestfulOnlineExecutor.java b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/executor/RestfulOnlineExecutor.java
new file mode 100644
index 00000000000..3145968e1f1
--- /dev/null
+++ b/test/integration-test/openmldb-test-java/openmldb-http-test/src/main/java/com/_4paradigm/openmldb/http_test/executor/RestfulOnlineExecutor.java
@@ -0,0 +1,179 @@
+package com._4paradigm.openmldb.http_test.executor;
+
+
+import com._4paradigm.openmldb.test_common.restful.common.OpenMLDBHttp;
+import com._4paradigm.openmldb.test_common.restful.model.HttpMethod;
+import com._4paradigm.openmldb.test_common.model.SQLCase;
+import com._4paradigm.openmldb.test_common.model.InputDesc;
+import com._4paradigm.openmldb.test_common.common.BaseExecutor;
+import com._4paradigm.openmldb.test_common.restful.model.HttpResult;
+import com._4paradigm.openmldb.test_common.command.OpenMLDBCommandFactory;
+import com._4paradigm.openmldb.http_test.util.HttpUtil;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import org.testng.Assert;
+import org.apache.commons.collections4.CollectionUtils;
+import com._4paradigm.openmldb.test_common.command.OpenMLDBCommandUtil;
+import com._4paradigm.openmldb.test_common.provider.YamlUtil;
+import com._4paradigm.openmldb.test_common.util.Tool;
+import com._4paradigm.qa.openmldb_deploy.bean.OpenMLDBInfo;
+import com._4paradigm.openmldb.test_common.restful.model.HttpData;
+import com.google.gson.Gson;
+
+
+public class RestfulOnlineExecutor extends BaseExecutor {
+
+ public RestfulOnlineExecutor(SQLCase sqlCase) {
+ super(sqlCase);
+ }
+
+ protected List tables = sqlCase.getInputs();
+ protected HttpResult httpresult;
+ protected String deploy;
+ protected OpenMLDBInfo openMLDBInfo= YamlUtil.getObject(Tool.openMLDBDir().getAbsolutePath()+"/out/openmldb_info.yaml",OpenMLDBInfo.class);
+ protected String defaultDb = null==sqlCase.getDb()||sqlCase.getDb().equals("null") ? "test_apiserver": sqlCase.getDb();
+ String apiServerUrl;
+ OpenMLDBHttp openMLDBHttp = new OpenMLDBHttp();
+
+ @Override
+ public boolean verify(){
+ if(null != sqlCase.getMode() && sqlCase.getMode().contains("request-unsupport")){
+ return false;
+ }
+ if(null != sqlCase.getMode() && sqlCase.getMode().contains("cluster-unsupport")){
+ return false;
+ }
+ if(null != sqlCase.getMode() && sqlCase.getMode().contains("hybridse-only")){
+ return false;
+ }
+ if(null != sqlCase.getMode() && sqlCase.getMode().contains("apiserver-unsupport")){
+ return false;
+ }
+ if(null != sqlCase.getMode() && sqlCase.getMode().contains("rtidb-unsupport")){
+ return false;
+ }
+ if(null != sqlCase.getMode() && sqlCase.getMode().contains("procedure-unsupport")){
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public void prepare() {
+ dbName = defaultDb;
+ apiServerUrl = "http://"+openMLDBInfo.getApiServerEndpoints().get(0);
+ List tables = sqlCase.getInputs();
+ OpenMLDBCommandUtil.createDatabases(openMLDBInfo,dbName,tables);
+ OpenMLDBCommandFactory.runNoInteractive(openMLDBInfo, dbName, "set @@global.execute_mode='online'");
+ if (!CollectionUtils.isEmpty(tables)) {
+ OpenMLDBCommandUtil.createTables(openMLDBInfo, dbName, tables);
+ for (InputDesc table : tables) {
+ tableNames.add(table.getName());
+ }
+ }
+ Random r = new Random(System.currentTimeMillis());
+ deploy = tableNames.get(0)+String.valueOf(r.nextInt(1000000));
+ String tmpSql = sqlCase.getSql().toString().replaceAll("\'","\"");
+ String options = sqlCase.getLongWindow()!=null? "OPTIONS(long_windows=\""+sqlCase.getLongWindow()+"\",RANGE_BIAS=\"inf\", ROWS_BIAS=\"inf\") "
+ :"OPTIONS(RANGE_BIAS=\"inf\", ROWS_BIAS=\"inf\") ";
+ tmpSql = options + tmpSql;
+ OpenMLDBCommandFactory.runNoInteractive(openMLDBInfo, dbName, "deploy "+deploy+" "+tmpSql);
+ String uri = "/dbs/"+dbName+"/deployments/"+deploy;
+ HttpResult result = openMLDBHttp.restfulJsonRequest(apiServerUrl,uri,"",HttpMethod.GET);
+ if(result.getData().contains("\"code\":-1")){
+ openMLDBResult.setMsg("deploy fail");
+ return;
+ }
+
+ // first table and data set as request, skipped in prepare stage, other tables and data set as base, added
+ if (tables.size()>1){
+ for (int i=1;i0? tables.get(i).getDb(): dbName;
+ uri = "/dbs/"+curDb+"/tables/"+tableNames.get(i);
+ OpenMLDBHttp openMLDBHttp = new OpenMLDBHttp();
+ openMLDBHttp.restfulJsonRequest(apiServerUrl,uri,body,HttpMethod.PUT);
+ }
+ }
+ }
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void execute(){
+ if(openMLDBResult.getMsg().equals("deploy fail")){
+ openMLDBResult.setOk(false);
+ return;
+ }
+ List> tmpResults = new ArrayList>();
+ HttpResult result = new HttpResult();
+
+ // set row i as request line, insert row i, repeat
+ for (int i=0;i tmpResult = (List