'How to ignore errors in redshift copy command
I've parquet files and need to load into redshift using copy command. The command is getting failed due to spectrum scan error. So I want to ignore the file if any causing error.
Is there any way to ignore records/maxerror option in redshift copy command for parquet file load?
COPY <targettablename> from '<s3 path>' iam_role 'arn:aws:iam::1232432' format as parquet maxerror 250
Error:- MAXERROR argument is not supported for PARQUET based COPY
Solution 1:[1]
- For copying data from parquet file to Redshift, you just use this below format-
Copy SchemaName.TableName From 'S3://buckets/file path' access_key_id 'Access key id details' secret_access_key 'Secret access key details' Format as parquet STATUPDATE off
Spectrum scan error you get when there is discrepancy in source columns data type and destination column data types, for that you have to change data types according to Redshift's standard data type format.
For checking errors you can refer this query-
Select * from SVL_S3LOG where query = 'Query_id needs to be placed here'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ashutosh Sharma |