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 动态数据帧。我的 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。有没有办法获得实际读取了哪些对象的列表?当我使用书签时,已经处理过的文件将是 'ignored'。这些忽略的文件应该从读取对象列表中省略。

你可以试试这个:dyf.toDF().withColumn("input_file", input_file_name()).select("input_file").distinct().show()