-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: file not purged when copy into table. (#13812)
fix: file not purge when copy into table.
- Loading branch information
1 parent
a0cb2f6
commit df815ca
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/suites/1_stateful/00_stage/00_0002_copy_purge.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
>>>> drop table if exists ii | ||
>>>> create table ii(a int, b int) | ||
>>>> drop stage if exists s_ii | ||
>>>> create stage s_ii url='fs:///tmp/00_0002/'; | ||
>>>> copy into ii from @s_ii file_format = (type = CSV) purge = true | ||
<<<< | ||
>>>> list @s_ii | ||
<<<< | ||
>>>> select * from ii | ||
1 1 | ||
2 2 | ||
>>>> truncate table ii | ||
>>>> copy into ii from @s_ii file_format = (type = CSV) files = ('i1.csv') purge = true | ||
<<<< | ||
>>>> list @s_ii | ||
<<<< | ||
>>>> select * from ii | ||
1 1 | ||
2 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
. "$CURDIR"/../../../shell_env.sh | ||
|
||
rm -rf /tmp/00_0002 | ||
mkdir -p /tmp/00_0002 | ||
cat << EOF > /tmp/00_0002/i0.csv | ||
1,1 | ||
2,2 | ||
EOF | ||
|
||
stmt "drop table if exists ii" | ||
stmt "create table ii(a int, b int)" | ||
|
||
stmt "drop stage if exists s_ii" | ||
stmt "create stage s_ii url='fs:///tmp/00_0002/';" | ||
|
||
query "copy into ii from @s_ii file_format = (type = CSV) purge = true" | ||
|
||
query "list @s_ii" | ||
|
||
stmt "select * from ii" | ||
|
||
stmt "truncate table ii" | ||
|
||
cat << EOF > /tmp/00_0002/i1.csv | ||
1,1 | ||
2,2 | ||
EOF | ||
|
||
query "copy into ii from @s_ii file_format = (type = CSV) files = ('i1.csv') purge = true" | ||
|
||
query "list @s_ii" | ||
|
||
stmt "select * from ii" |