Skip to content

Commit a6e2094

Browse files
committed
test: test copy into table with transform.
1 parent d0f9482 commit a6e2094

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
statement ok
2+
DROP DATABASE IF EXISTS db1
3+
4+
statement ok
5+
CREATE DATABASE db1
6+
7+
statement ok
8+
USE db1
9+
10+
statement ok
11+
CREATE TABLE test_table(id INTEGER, age INT)
12+
13+
statement ok
14+
insert into test_table (id, age) values (1,3)
15+
16+
statement ok
17+
DROP STAGE IF EXISTS test
18+
19+
statement ok
20+
CREATE STAGE IF NOT EXISTS test
21+
22+
statement ok
23+
copy into @test from test_table FILE_FORMAT = (type = parquet)
24+
25+
statement ok
26+
copy into test_table from (select (t.id+1), age from @test t) FILE_FORMAT = (type = parquet)
27+
28+
query II
29+
select * from test_table order by id
30+
----
31+
1 3
32+
2 3
33+
34+
statement error 1016
35+
copy into test_table from (select (t.id+1), age from @test t) FILE_FORMAT = (type = parquet)
36+
37+
statement ok
38+
copy into test_table from (select (t.id+1), age from @test t) FILE_FORMAT = (type = parquet) force=true
39+
40+
query II
41+
select * from test_table order by id
42+
----
43+
1 3
44+
2 3
45+
2 3

0 commit comments

Comments
 (0)