我尝试使用Glue的fromDF方法将Python 3.10中的Spark Dataframe 转换为动态帧
第一个月DynamicFrame.fromDF(frame, glue_context, "node")
个
但这会在CloudWatch上引发错误,显示com.mongodb.spark.sql.connector.exceptions.MongoSparkException: Partitioning failed.
进一步检查日志,我发现Glue似乎在某个地方使用了$collStats
,这是AWS DocumentDB不支持的。请注意,当作业是Glue 2.0时,此功能可以工作,但将其更新到4.0已经开始导致此问题。com.mongodb.MongoCommandException: Command failed with error 304: 'Aggregation stage not supported: '$collStats''
个
我还没有真正尝试修复这个问题,因为这似乎是在引擎盖下发生的,我没有访问Glue 4.0的源代码。唯一的问题是,这在Glue 2.0中没有失败。
1条答案
按热度按时间gjmwrych1#
对我有用的是将mongo-spark的批处理读取配置中的分区程序设置为
SinglePartitionParititoner
。似乎在Glue 4.0和更新的mongo-spark连接器版本中,默认值被更新为使用SamplePartitioner
,这导致了问题。Refer the documentation