forked from becloudready/snowflake-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwork.sql
More file actions
30 lines (23 loc) · 858 Bytes
/
work.sql
File metadata and controls
30 lines (23 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use warehouse sf_tuts_wh;
use database sf_tuts;
create or replace table information (
first_name string ,
last_name string ,
email string ,
streetaddress string ,
city string ,
start_date date
);
copy into information
from s3://sevenone credentials=(aws_key_id='REDACTED' aws_secret_key='REDACTED')
file_format = (type = csv field_optionally_enclosed_by='"')
pattern = '.*employees0[1-5].csv'
on_error = 'skip_file';
create or replace function name2()
returns table (email string, city string)
as
$$
select email, city from information
$$
;
select * from table (name2());