raffee
raffee

Reputation: 13

snowflake validate function not showing errors

I am using below code .actual file has data with pipe(|) but to check errors i used comma(,) script is given below.

create or replace stage bulk_copy_example_stage 
  url = 's3://snowflake-essentials/ingesting_data/new_customer';

select * from customer;

copy into customer
from @bulk_copy_example_stage
pattern     = '.*.csv'
file_format = (type = csv field_delimiter = ',' skip_header = 1);

When I run this query i got error.

I am checking error by using validate function but i am getting null.

select * from table(
  validate(customer, job_id=>'01955b28-00e1-af61-0000-0000246d4489')
);`

How to check the errors occurred when use copy into table syntax.

Upvotes: 1

Views: 209

Answers (1)

MMV
MMV

Reputation: 980

Validate only makes sense if you are using on_error - otherwise you just get the first error, the load stops and that's it.

Try adding for example on_error=skip_file to your file format, I'm sure it's going to work in this case

Upvotes: 2

Related Questions