Skip to content

Commit

Permalink
test: test select from stage with files/pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Feb 3, 2023
1 parent 01ad713 commit a8da034
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "create stage s1 FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT
echo "copy into @s1 from t1;" | $MYSQL_CLIENT_CONNECT
echo "select * from @s1;" | $MYSQL_CLIENT_CONNECT

DATADIR_PATH="/tmp/00_0004_select_stage"
DATADIR_PATH="/tmp/08_00_00"
rm -rf ${DATADIR_PATH}
DATADIR="fs://$DATADIR_PATH/"
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1 (1,'a')
2 (3,'b')
3 (3,'c')
---
1 (1,'a')
2 (3,'b')
3 (3,'c')
1 (1,'a')
2 (3,'b')
3 (3,'c')
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../../../../shell_env.sh


DATADIR_PATH="/tmp/08_00_02"
rm -rf ${DATADIR_PATH}
mkdir ${DATADIR_PATH}
DATADIR="fs://$DATADIR_PATH/"

echo "drop stage if exists s2;" | $MYSQL_CLIENT_CONNECT
echo "create stage s2 url = '${DATADIR}' FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT


cp "$CURDIR"/../../../../data/tuple.parquet ${DATADIR_PATH}/
cp "$CURDIR"/../../../../data/sample.csv ${DATADIR_PATH}/

echo "select * from @s2 (files => ('tuple.parquet'));" | $MYSQL_CLIENT_CONNECT

echo "---"

cp "$CURDIR"/../../../../data/tuple.parquet ${DATADIR_PATH}/tuple2.parquet
echo "select * from @s2 (pattern => '.*parquet');" | $MYSQL_CLIENT_CONNECT

0 comments on commit a8da034

Please sign in to comment.