![](/img/trans.png)
[英]glue etl jobs - get s3 subfolders using create_dynamic_frame.from_options
[英]AWS Glue: Get list of objects read by create_dynamic_frame.from_options
我正在使用create_dynamic_frame.from_options
將 CSV 文件讀入 Glue Dynamic Dataframe。 我的 Glue 工作正在使用書簽,並且from_options
配置了轉換 ctx 和遞歸搜索。
dyf = glueContext.create_dynamic_frame.from_options("s3",
{
"paths": [
"s3://bucket/files/"
],
"recurse" : True
},
transformation_ctx = "example"
)
s3://bucket/files
包含多個 CSV。 有沒有辦法獲取實際讀取了哪些對象的列表? 當我使用書簽時,已經處理過的文件將被“忽略”。 這些被忽略的文件應該從讀取對象列表中省略。
你可以試試這個: dyf.toDF().withColumn("input_file", input_file_name()).select("input_file").distinct().show()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.