-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: copy option 'pattern' support variable.
- Loading branch information
1 parent
bb92fdc
commit 6fe9c16
Showing
7 changed files
with
102 additions
and
18 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
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
tests/sqllogictests/suites/stage/options/pattern_variable.test
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,31 @@ | ||
statement ok | ||
create or replace table t1(c1 int, c2 string); | ||
|
||
statement ok | ||
set variable pt='it.csv'; | ||
|
||
query | ||
select $1 from @data/csv/ (pattern => $pt, file_format=>'csv') | ||
---- | ||
1 | ||
2 | ||
|
||
query | ||
copy into t1 from @data/csv/ pattern= $pt file_format=(type=csv) | ||
---- | ||
csv/it.csv 2 0 NULL NULL | ||
|
||
query | ||
select * from t1 | ||
---- | ||
1 b | ||
2 d | ||
|
||
statement ok | ||
unset variable pt; | ||
|
||
query error 1006 | ||
copy into t1 from @data/csv/ pattern= $p file_format=(type=csv) | ||
|
||
query error 1065 | ||
copy into t1 from @data/csv/ pattern=x file_format=(type=csv) |