到目前为止,我已经用单个文件夹完成了这项工作,因为COPY Command
提取文件的数据并使用prefix
将其加载到红移表中,现在我想从两个不同的文件夹/桶中提取相同的数据并将其加载进红移表中。我用过这个:
copy MyTable
FROM 's3://my-bucket/connect/Reports'
iam_role 'arn:aws:iam::my-role:role/RedshiftRoleForS3'
csv
null as ' 00'
IGNOREHEADER 1;
我已经尝试了manifest,但manifest的问题是我无法获取/提取带有前缀的数据。
{
"entries": [
{"url":"s3://my-bucket1/connect/Reports", "mandatory":true},
{"url":"s3://my-bucket2/connect/Reports", "mandatory":true}
]
}
copy myTable
FROM 's3://my-bucket1/connect/ABC.manifest'
iam_role 'arn:aws:iam::my-role:role/RedshiftForS3'
manifest
csv
null as ' 00'
IGNOREHEADER 1;
因为我必须提取文件夹CCD_ 3中包含的所有文件的数据。如何实现?有解决方案吗?我们如何使用Prefix in Manifest
方法?
使用清单指定数据文件-Amazon Redshift:
清单中的URL必须指定文件的存储桶名称和完整对象路径,而不仅仅是前缀。
因此,似乎不可能在Redshift清单文件中指定路径。