我正在创建一个AWS Glue ETL作业,但是在文件检索方面遇到了一些障碍。
似乎以下代码仅获取根文件夹2017中的文件,而不再获取。有没有办法在其中包含所有子文件夹和文件?
dyf = glueContext.create_dynamic_frame.from_options(
's3',
{"paths": [
's3://bucket/2017/'
]},
"json",
transformation_ctx = "dyf")
找到了这个问题的解决方案,看起来字典接受了更多的参数,我需要的是“递归”。您也可以使用“排除”排除某些模式。
dyf = glueContext.create_dynamic_frame.from_options(
's3',
{
"paths": [
's3://bucket/2017/'
],
"recurse" : True
},
"json",
transformation_ctx = "dyf")