在粘贴作业中,我使用胶合连接从AWS RDS PSQL创建了dynamic_frame,并在执行了一些ETL作业后将数据写入S3 . 之后,我创建并运行了Glue Crawler,用于在S3中编写的镶木地板文件 . 这是示例代码 .
dynamic_frame = glueContext.create_dynamic_frame_from_options('postgresql',
connection_options)
glueContext.write_dynamic_frame.from_options(
frame=cleaned_dynamic_frame,
connection_type="s3",
connection_options={"path": export_path},
format="parquet")
response = glue.create_crawler(
Name=crawler_name,
Role=role,
DatabaseName=db_name,
Targets={
'S3Targets': [
{
'Path': path
}
]
},
TablePrefix='{}_'.format(table_name)
)
### S3 Objects list in the path (20 parquet files)
<bucket>/<path>/part-0000-a.snappy.parquet
<bucket>/<path>/part-0001-b.snappy.parquet
<bucket>/<path>/part-0002-c.snappy.parquet
<bucket>/<path>/part-0003-d.snappy.parquet
<bucket>/<path>/part-0004-e.snappy.parquet
<bucket>/<path>/part-0005-f.snappy.parquet
<bucket>/<path>/part-0006-g.snappy.parquet
<bucket>/<path>/part-0007-h.snappy.parquet
<bucket>/<path>/part-0008-i.snappy.parquet
问题:胶水爬虫应该为这些镶木地板数据创建一个具有相同模式的表 . 但是,胶水爬行器以某种方式为每个镶木地板数据创建了多个表格,每个表格的位置都是针对每个镶木地板数据 . 没合并 . 这种情况有时发生..有时候工作正常......
我的猜测是,在完成粘合作业之前,spark会将_temporary文件创建到s3 ...并且在临时文件存在的那一刻,粘合爬虫正在运行,它会为每个文件创建每个表 .
如果你有任何意义,请在下面评论 . 谢谢你的帮助 .