簡體   English   中英

AWS Glue:獲取由 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM