雪花验证功能未显示错误

时间:2020-07-05 06:03:21

标签: snowflake-cloud-data-platform

我正在使用以下代码。实际文件中的数据带有pipe(|),但为了检查错误,我使用了逗号(,) 脚本如下。

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);

运行此查询时出现错误。

我正在通过使用validate函数检查错误,但是我得到了空值。

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

如何检查使用复制到表语法时发生的错误。

1 个答案:

答案 0 :(得分:2)

只有在使用on_error时,验证才有意义-否则,您只会遇到第一个错误,加载就会停止,仅此而已。

尝试将on_error=skip_file添加到您的文件格式,在这种情况下,我确定它可以正常工作

相关问题