Getting Spectrum Scan Error code 15007 on select query on redshift external table

Viewed 2255

I have created a external table in redshift spectrum.Upon running the select * from table_name, i am getting following error

SQL Error [XX000]: ERROR: Spectrum Scan Error
  Detail: 
  -----------------------------------------------
  error:  Spectrum Scan Error
  code:      15007
  context:   Forbidden: HTTP response error code: 403 Message: AccessDenied Access Denied

Please let me know what can be issue. I am able to do aws s3 ls and aws s3 cp command on same s3 location.

2 Answers

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'

In my case at least, the fix for this exact error was to allow the Redshift IAM role to decrypt using the KMS key on the S3 bucket.

Related