Skip to content

Commit 5a280cf

Browse files
committed
test: transform test add copy from s3.
1 parent dc2c12d commit 5a280cf

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ ERROR 1105 (HY000) at line 1: Code: 1002, displayText = stage table function onl
2424
4 6
2525
5 6
2626
5 6
27+
--- copy from s3
28+
2
29+
3
30+
4

tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,32 @@ DATADIR="fs://$DATADIR_PATH/"
1313
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT
1414
touch ${DATADIR_PATH}/transform.csv
1515

16-
echo "drop stage if exists s2;" | $MYSQL_CLIENT_CONNECT
17-
echo "create stage s2 url = '${DATADIR}' FILE_FORMAT = (type = TSV);" | $MYSQL_CLIENT_CONNECT
16+
echo "drop stage if exists s1;" | $MYSQL_CLIENT_CONNECT
17+
echo "create stage s1 url = '${DATADIR}' FILE_FORMAT = (type = TSV);" | $MYSQL_CLIENT_CONNECT
1818

1919
echo '--- copy 1'
20-
echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT
20+
echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT
2121
echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
2222

2323
echo '--- copy 2'
24-
echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT
24+
echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet';" | $MYSQL_CLIENT_CONNECT
2525
echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
2626

2727
echo '--- copy 3'
28-
echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet' force=true;" | $MYSQL_CLIENT_CONNECT
28+
echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = parquet) PATTERN='.*parquet' force=true;" | $MYSQL_CLIENT_CONNECT
2929
echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
3030

3131
echo '--- copy csv'
32-
echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = csv) PATTERN='.*csv' force=true;" | $MYSQL_CLIENT_CONNECT
32+
echo "copy into t1 from (select (t.id+1), age from @s1 t) FILE_FORMAT = (type = csv) PATTERN='.*csv' force=true;" | $MYSQL_CLIENT_CONNECT
3333
echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
3434

35-
#rm -rf ${DATADIR_PATH}
35+
echo '--- copy from s3'
36+
echo "drop table if exists t2;" | $MYSQL_CLIENT_CONNECT
37+
echo "CREATE TABLE t2 (a INT32);" | $MYSQL_CLIENT_CONNECT
38+
39+
echo "drop stage if exists s2;" | $MYSQL_CLIENT_CONNECT
40+
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
41+
echo "copy into t2 from (select (t.id+1) from @s2 t) files=('tuple.parquet');" | $MYSQL_CLIENT_CONNECT
42+
echo "select * from t2 order by a;" | $MYSQL_CLIENT_CONNECT
43+
44+
rm -rf ${DATADIR_PATH}

0 commit comments

Comments
 (0)