在将S3文件导入到Redshifit,提示错误:
psycopg2.InternalError: Load into table 'table_name' failed. Check 'stl_load_errors' system table for details.并没有具体的错误原因,只能按照提示查系统表stl_load_errors。
解决方案:
在Redshift中查询系统表STL_LOAD_ERRORS:
SELECT * FROM STL_LOAD_ERRORS where filename like '%S3上的文件名%' order by starttime desc limit 10
最后两列err_code,err_reason。根据error_reason就是具体的错误原因。
也可以参照官网中对于err_code的解释:
https://docs.aws.amazon.com/redshift/latest/dg/r_Load_Error_Reference.html