AWS:从s3使用copy命令到redshift

时间:2017-05-16 16:19:42

标签: python amazon-web-services amazon-s3

我在s3中有大数据并且必须进入redshift,并且有一个表在redshift中。由于我使用python,我编写了python脚本并使用psycopg2来连接redshift。我成功连接到redshift,但是我无法将数据从s3插入到redshift。 我在aws网站上检查了仪表板,发现redshift收到了一个查询并加载了一些东西,但它没有插入任何东西,这个过程消耗的时间太长,就像超过3分钟。没有错误日志,所以我无法找到原因。

这有可能的原因吗?

EDIT 添加了我使用的复制命令。

copy table FROM 's3://example/2017/02/03/' access_key_id '' secret_access_key '' ignoreblanklines timeformat 'epochsecs' delimiter '\t';

1 个答案:

答案 0 :(得分:0)

尝试查询stl_load_errors表,它有关于数据加载错误的信息 http://docs.aws.amazon.com/redshift/latest/dg/r_STL_LOAD_ERRORS.html

select * from stl_load_errors order by starttime desc limit 1