将 Windows 个 txt 文件中的数据插入 Redshift

Insert data into Redshift from Windows txt files

我在 windows 上有 50 个 txt 文件,我想将它们的数据插入到 Redshift 上的单个 table 中。 我创建了基本的 table 结构,但现在我在插入数据时遇到了问题。我尝试使用 SQLWorkbench/J 中的 COPY 命令,但没有成功。

命令如下:

copy feed
from 'F:\Data\feed\feed1.txt'
credentials 'aws_access_key_id=<access>;aws_secret_access_key=<key>'

这是错误:

 -----------------------------------------------
  error:  CREDENTIALS argument is not supported when loading from file system
  code:      8001
  context:   
  query:     0
  location:  xen_load_unload.cpp:333
  process:   padbmaster [pid=1970]
  -----------------------------------------------;

删除 Credentials 参数后,这是我得到的错误:

[Amazon](500310) Invalid operation: LOAD source is not supported. (Hint: only S3 or DynamoDB or EMR based load is allowed);

我不是 UNIX 用户,所以我真的不知道该怎么做。在这方面的任何帮助将不胜感激。

@patthebug 是正确的,因为 Redshift 无法看到您的本地 Windows 驱动器。您必须将数据推送到 S3 存储桶中。每个 http://docs.aws.amazon.com/redshift/latest/dg/t_Loading_tables_with_the_COPY_command.html, but they seem outside the context you're working with. I suggest you get a copy of Cloudberry Explorer (http://www.cloudberrylab.com/free-amazon-s3-explorer-cloudfront-IAM.aspx) 您可以使用一些额外的来源,您可以使用它们将这些文件复制到 S3。