-
Notifications
You must be signed in to change notification settings - Fork 762
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. (#16525)
* feat: copy option 'pattern' support variable. * refactor: pattern use type LiteralStringOrVariable. * fix * fix
- Loading branch information
1 parent
131d2d8
commit 034ec72
Showing
9 changed files
with
138 additions
and
28 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
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 1005 | ||
copy into t1 from @data/csv/ pattern=x file_format=(type=csv) |