SF Dataloading Commands
SF Dataloading Commands
insert overwrite into TARGET.TRIPS ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11,
$12, $13, $14, $15)
select t.$1, t.$2, t.$3, t.$4, t.$5, t.$6, t.$7, t.$8, t.$9, t.$10, t.$11, t.$12,
t.$13, t.$14, t.$15
from stage.TRIPS_STG t;
--------------------------------------------------------
--windows
insert overwrite into TARGET.TRIPS ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11,
$12, $13, $14, $15)
select t.$1, t.$2, t.$3, t.$4, t.$5, t.$6, t.$7, t.$8, t.$9, t.$10, t.$11, t.$12,
t.$13, t.$14, t.$15
from stage.TRIPS_STG t;
s3-snowflake-event-based
-------------------------
Create SnowPipe:
----------------
CREATE OR REPLACE PIPE CDS_S3DB.TARGET.S3_TABLE_snowpipe AUTO_INGEST = TRUE
AS COPY INTO CDS_S3DB.TARGET.S3_TABLE
FROM @CDS_S3DB.STAGE.S3_STAGE
FILE_FORMAT = flatfiles_db.public.csv_format
ls @CDS_S3DB.STAGE.S3_STAGE
select system$pipe_status('CDS_S3DB.TARGET.S3_TABLE_snowpipe');
Refreshing Pipe :
-----------------
ALTER PIPE CDS_S3DB.TARGET.S3_TABLE_snowpipe refresh
select *
from table(information_schema.copy_history(table_name=>'CDS_S3DB.TARGET.S3_TABLE',
start_time=> dateadd(hours, -1, current_timestamp())));
s3-snowflake-time-based
=========================
--------------------------------------------------
---------------
----------------------
list @sales_data_ext_part_s3_stage;
select *
from
table(information_schema.external_table_file_registration_history(TABLE_NAME=>'sale
s_data_ext_partiti
on_table'));
select *
from table(information_schema.external_table_files
(TABLE_NAME=>'sales_data_ext_partition_table'));
------------------