Skip to content

Commit 699f743

Browse files
committed
fix test.
1 parent a6e2094 commit 699f743

File tree

4 files changed

+55
-49
lines changed

4 files changed

+55
-49
lines changed

tests/sqllogictests/suites/base/03_common/03_0038_copy_into_table_with_transform

Lines changed: 0 additions & 45 deletions
This file was deleted.

tests/sqllogictests/suites/base/issues/issue_10103.test

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ statement ok
1717
insert into test_table (id,name,age) values (1676805481000000,'2',3), (1676805481000000, '5', 6)
1818

1919
statement ok
20-
CREATE STAGE IF NOT EXISTS test
20+
DROP STAGE IF EXISTS test_10103
2121

2222
statement ok
23-
copy into @test from test_table FILE_FORMAT = (type = CSV)
23+
CREATE STAGE IF NOT EXISTS test_10103
2424

2525
statement ok
26-
copy into test_ts_table from @test FILE_FORMAT = (type = CSV)
26+
copy into @test_10103 from test_table FILE_FORMAT = (type = CSV)
27+
28+
statement ok
29+
copy into test_ts_table from @test_10103 FILE_FORMAT = (type = CSV)
2730

2831
query A
2932
SELECT ts FROM test_ts_table LIMIT 1
@@ -37,7 +40,7 @@ statement ok
3740
drop table test_ts_table all
3841

3942
statement ok
40-
drop stage test
43+
drop stage test_10103
4144

4245
statement ok
4346
DROP DATABASE db1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- copy 1
2+
1 3
3+
2 3
4+
4 6
5+
5 6
6+
--- copy 2
7+
ERROR 1105 (HY000) at line 1: Code: 1016, displayText = no file need to copy.
8+
1 3
9+
2 3
10+
4 6
11+
5 6
12+
--- copy 3
13+
1 3
14+
2 3
15+
2 3
16+
4 6
17+
5 6
18+
5 6
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
. "$CURDIR"/../../../../shell_env.sh
5+
6+
echo "drop table if exists t1;" | $MYSQL_CLIENT_CONNECT
7+
echo "CREATE TABLE t1 (id INT, age INT);" | $MYSQL_CLIENT_CONNECT
8+
echo "insert into t1 (id, age) values(1,3), (4, 6);" | $MYSQL_CLIENT_CONNECT
9+
10+
DATADIR_PATH="/tmp/08_00_00"
11+
rm -rf ${DATADIR_PATH}
12+
DATADIR="fs://$DATADIR_PATH/"
13+
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT
14+
15+
echo "drop stage if exists s2;" | $MYSQL_CLIENT_CONNECT
16+
echo "create stage s2 url = '${DATADIR}' FILE_FORMAT = (type = PARQUET);" | $MYSQL_CLIENT_CONNECT
17+
18+
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 "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
21+
22+
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 "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
25+
26+
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 "select * from t1 order by id;" | $MYSQL_CLIENT_CONNECT
29+
30+
rm -rf ${DATADIR_PATH}

0 commit comments

Comments
 (0)