From 5a280cf9e3a408afebb8d90c8acac2a8db2c2bc0 Mon Sep 17 00:00:00 2001 From: Yang Xiufeng Date: Wed, 15 Mar 2023 09:17:44 +0800 Subject: [PATCH] test: transform test add copy from s3. --- .../08_00_parquet/08_00_06_transform.result | 4 ++++ .../08_00_parquet/08_00_06_transform.sh | 23 +++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.result b/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.result index 4e3c6102d3642..9cc80d908c2d9 100755 --- a/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.result +++ b/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.result @@ -24,3 +24,7 @@ ERROR 1105 (HY000) at line 1: Code: 1002, displayText = stage table function onl 4 6 5 6 5 6 +--- copy from s3 +2 +3 +4 diff --git a/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.sh b/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.sh index 51607599ffe8f..10160adb92ae7 100755 --- a/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.sh +++ b/tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.sh @@ -13,23 +13,32 @@ DATADIR="fs://$DATADIR_PATH/" echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT touch ${DATADIR_PATH}/transform.csv -echo "drop stage if exists s2;" | $MYSQL_CLIENT_CONNECT -echo "create stage s2 url = '${DATADIR}' FILE_FORMAT = (type = TSV);" | $MYSQL_CLIENT_CONNECT +echo "drop stage if exists s1;" | $MYSQL_CLIENT_CONNECT +echo "create stage s1 url = '${DATADIR}' FILE_FORMAT = (type = TSV);" | $MYSQL_CLIENT_CONNECT echo '--- copy 1' -echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT +echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT echo '--- copy 2' -echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT +echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT echo '--- copy 3' -echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet' force=true;" | $MYSQL_CLIENT_CONNECT +echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet' force=true;" | $MYSQL_CLIENT_CONNECT echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT echo '--- copy csv' -echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = csv) PATTERN='.*csv' force=true;" | $MYSQL_CLIENT_CONNECT +echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = csv) PATTERN='.*csv' force=true;" | $MYSQL_CLIENT_CONNECT echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT -#rm -rf ${DATADIR_PATH} +echo '--- copy from s3' +echo "drop table if exists t2;" | $MYSQL_CLIENT_CONNECT +echo "CREATE TABLE t2 (a INT32);" | $MYSQL_CLIENT_CONNECT + +echo "drop stage if exists s2;" | $MYSQL_CLIENT_CONNECT +echo "create stage s2 url='s3://testbucket/admin/data/' connection=(aws_key_id = 'minioadmin' aws_secret_key = 'minioadmin' endpoint_url = 'http://127.0.0.1:9900/') file_format = (type=parquet)" | $MYSQL_CLIENT_CONNECT +echo "copy into t2 from (select (t.id+1) from @s2 t) files=('tuple.parquet');" | $MYSQL_CLIENT_CONNECT +echo "select * from t2 order by a;" | $MYSQL_CLIENT_CONNECT + +rm -rf ${DATADIR_PATH}