From 31edb4ec6886509e5e90c552f12c3c07b6af1f85 Mon Sep 17 00:00:00 2001 From: Yang Xiufeng Date: Thu, 7 Dec 2023 16:28:50 +0800 Subject: [PATCH] add test for delta table engine. --- .../12_delta/11_0000_delta_engine.result | 26 +++++++++++++++++++ .../12_delta/11_0000_delta_engine.sh | 25 ++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 tests/suites/1_stateful/12_delta/11_0000_delta_engine.result create mode 100755 tests/suites/1_stateful/12_delta/11_0000_delta_engine.sh diff --git a/tests/suites/1_stateful/12_delta/11_0000_delta_engine.result b/tests/suites/1_stateful/12_delta/11_0000_delta_engine.result new file mode 100755 index 0000000000000..c2415a8f249a2 --- /dev/null +++ b/tests/suites/1_stateful/12_delta/11_0000_delta_engine.result @@ -0,0 +1,26 @@ +>>>> drop table if exists test_delta; +>>>> create table test_delta engine = delta location = 'fs://${ROOT}/'; +>>>> select * from test_delta order by id; +0 +1 +2 +3 +4 +<<<< +>>>> drop table test_delta; +>>>> drop connection if exists s3_conn; +>>>> create connection s3_conn storage_type = 's3' access_key_id ='minioadmin' secret_access_key ='minioadmin' ENDPOINT_URL='http://127.0.0.1:9900'; +>>>> create table test_delta engine = delta location = 's3://testbucket/admin/data/delta/delta-table' connection_name = 's3_conn' ; +>>>> select * from test_delta order by id; +0 +1 +2 +3 +4 +<<<< +>>>> show create table test_delta; +test_delta CREATE TABLE `test_delta` ( + `id` INT NULL +) ENGINE=DELTA CONNECTION_NAME='s3_conn' LOCATION='s3://testbucket/admin/data/delta/delta-table' +<<<< +>>>> drop table test_delta; diff --git a/tests/suites/1_stateful/12_delta/11_0000_delta_engine.sh b/tests/suites/1_stateful/12_delta/11_0000_delta_engine.sh new file mode 100755 index 0000000000000..6191f428aade7 --- /dev/null +++ b/tests/suites/1_stateful/12_delta/11_0000_delta_engine.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../../../shell_env.sh + +ROOT=$(realpath "$CURDIR"/../../../data/delta/delta-table/) + +stmt "drop table if exists test_delta;" + +echo ">>>> create table test_delta engine = delta location = 'fs://\${ROOT}/';" +echo "create table test_delta engine = delta location = 'fs://${ROOT}/';" | $BENDSQL_CLIENT_CONNECT +# stmt "create table test_delta engine = delta location = 'fs://${ROOT}/';" +query "select * from test_delta order by id;" +stmt "drop table test_delta;" + +stmt "drop connection if exists s3_conn;" +stmt "create connection s3_conn storage_type = 's3' access_key_id ='minioadmin' secret_access_key ='minioadmin' ENDPOINT_URL='http://127.0.0.1:9900';" + +echo ">>>> create table test_delta engine = delta location = 's3://testbucket/admin/data/delta/delta-table' connection_name = 's3_conn' ;" +echo "create table test_delta engine = delta location = 's3://testbucket/admin/data/delta/delta-table' connection_name = 's3_conn';" | $BENDSQL_CLIENT_CONNECT +query "select * from test_delta order by id;" +query "show create table test_delta;" +stmt "drop table test_delta;" + +