Skip to content

Commit 2fcaba0

Browse files
committed
test: transform test csv and format overriding.
1 parent 4589d02 commit 2fcaba0

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ ERROR 1105 (HY000) at line 1: Code: 1016, displayText = no file need to copy.
1616
4 6
1717
5 6
1818
5 6
19+
--- copy csv
20+
ERROR 1105 (HY000) at line 1: Code: 1002, displayText = stage table function only support parquet format for now.
21+
1 3
22+
2 3
23+
2 3
24+
4 6
25+
5 6
26+
5 6

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,29 @@ echo "drop table if exists t1;" | $MYSQL_CLIENT_CONNECT
77
echo "CREATE TABLE t1 (id INT, age INT);" | $MYSQL_CLIENT_CONNECT
88
echo "insert into t1 (id, age) values(1,3), (4, 6);" | $MYSQL_CLIENT_CONNECT
99

10-
DATADIR_PATH="/tmp/08_00_00"
10+
DATADIR_PATH="/tmp/08_00_06"
1111
rm -rf ${DATADIR_PATH}
1212
DATADIR="fs://$DATADIR_PATH/"
1313
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT
14+
touch ${DATADIR_PATH}/transform.csv
1415

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

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

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

2627
echo '--- copy 3'
27-
echo "copy into t1 from (select (t.id+1), age from @s2 t) FILE_FORMAT = (type = parquet) force=true;" | $MYSQL_CLIENT_CONNECT
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
2829
echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
2930

30-
rm -rf ${DATADIR_PATH}
31+
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
33+
echo "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
34+
35+
#rm -rf ${DATADIR_PATH}

0 commit comments

Comments
 (0)