AWS Glue jobs not writing to S3

bil*_*obo 5 amazon-s3 aws-glue

I have just been playing around with Glue but have yet to get it to successfully create a new table in an existing S3 bucket. The job will execute without error but there is never any output in S3.

Here's what the auto generated code is:

glueContext.write_dynamic_frame.from_options(frame = applymapping1, 
connection_type = "s3", connection_options = {"path": 
"s3://glueoutput/output/"}, format = "json", transformation_ctx = 
"datasink2") 
Run Code Online (Sandbox Code Playgroud)

已经尝试了所有变体 - 文件名(尚不存在),在存储桶的根文件夹中,尾部斜杠和没有。正在使用的角色对 S3 具有完全访问权限。尝试在不同地区创建存储桶。虽然没有创建任何文件。控制台再次说它成功了。

Sin*_*dem 5

正如 @Drellgor 在对之前答案的评论中建议的那样,请确保禁用“作业书签”,除非您绝对不想处理旧文件。

文档中:

“AWS Glue 通过保存作业运行中的状态信息来跟踪上次运行 ETL 作业期间已处理的数据。这种保存的状态信息称为作业书签。作业书签可帮助 AWS Glue 维护状态信息并防止重新处理旧数据。”


小智 3

您的代码是正确的,只需验证 applymapping1 DF 中是否有任何数据即可?你用这个命令检查:applymapping1.toDF().show()

  • 这通过在日志中显示数据来证明动态框架有数据。我还禁用了书签。做这两件事为我解决了这个问题。 (2认同)