python - 粘合 etl 作业 - 使用 create_dynamic_frame.from_options 获取 s3 子文件夹
问题描述
我正在创建 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")
推荐阅读
- html - 单选按钮不会出现在文本旁边
- c# - 如何在 imagemagick C# 中使用 4 个角(x,y)剪辑图像
- python - Matplotlib:另一种颜色的形状内部
- java - Drive API v3 不支持提交的 html 的 css text-indent
- php - 有没有替代 laravel bcrypt 函数的函数
- c# - 带有.Net Standard HttpClient 的 Xamarin Forms 项目不从 api 返回响应
- java - 如何执行独立的 javaexec 任务
- javascript - 反应上下文:TypeError:渲染不是函数
- php - phalcon 关系返回 false
- go - 解释方法表达式的打印值