【发布时间】:2015-12-25 20:46:51
【问题描述】:
我正在尝试将 CSV 文件导入 Redshift 集群。我已成功完成the example in the Redshift documentation。现在我正在尝试从我自己的 CSV 文件中复制。
这是我的命令:
copy frontend_chemical from 's3://awssampledb/mybucket/myfile.CSV'
credentials 'aws_access_key_id=xxxxx;aws_secret_access_key=xxxxx'
delimiter ',';
这是我看到的错误:
An error occurred when executing the SQL command:
copy frontend_chemical from 's3://awssampledb/mybucket/myfile.CSV'
credentials 'aws_access_key_id=XXXX...'
[Amazon](500310) Invalid operation: The specified S3 prefix 'mybucket/myfile.CSV' does not exist
Details:
-----------------------------------------------
error: The specified S3 prefix 'mybucket/myfile.CSV' does not exist
code: 8001
context:
query: 3573
location: s3_utility.cpp:539
process: padbmaster [pid=2432]
-----------------------------------------------;
Execution time: 0.7s
1 statement failed.
我认为我构建的 S3 URL 错误,但我应该怎么做呢?
我的 Redshift 集群位于美国东部(弗吉尼亚北部)区域。
【问题讨论】:
-
如果我尝试使用 URL
s3://mybucket/myfile.CSV,即没有awssampledb,我会得到同样的错误。 -
mybucket 在您的复制命令中代表什么?
-
确保您在命令中提供的路径和文件名确实存在。 S3 在内部使用完整路径作为键名(文件名),因此完整路径应该正是您在复制命令中使用的路径。使用 AWS 控制台确保该文件存在于该路径。