Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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}