简体   繁体   English

Redshift复制不会将数据插入到我的表中

[英]Redshift copy doesn't insert data into my table

I have table SampleTable 我有表SampleTable

and run the following Redshift command through a SQL Client (JackDB) 并通过SQL客户端(JackDB)运行以下Redshift命令

copy SampleTable
from 's3://bucket-name/backup/data.csv.gz'
credentials 'aws_access_key_id=xxx;aws_secret_access_key=xxx'
gzip
csv;

the command does return 该命令确实返回

Executed successfully Updated 0 rows in 2.771 seconds. 成功执行在2.771秒内更新了0行。

but no data are inserted into empty table SampleTable 但没有数据插入到空表SampleTable中

select count(*)
from SampleTabe

return 0 返回0

there are 100MB data in data.csv.gz data.csv.gz中有100MB数据

solved by myself, the data do not correspond to the query. 由我自己解决,数据与查询不对应。

I should include delimiter to overwrite the default and IGNOREHEADER 1 to skip the csv header. 我应该包括定界符以覆盖默认值,并包括IGNOREHEADER 1以跳过csv标头。

just bothered by the fact that no stl_load_error is recorded in this case 只是因为在这种情况下没有记录stl_load_error而困扰

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM