我还没弄清楚,但我正在尝试将直接输出提交器与 AWS Glue 结合使用:
spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2
是否可以将此配置与 AWS Glue 一起使用?
最佳答案
选项 1:
Glue 使用 spark 上下文,您也可以将 hadoop 配置设置为 aws glue。因为内部动态框架是一种数据框架。
sc._jsc.hadoopConfiguration().set("mykey","myvalue")
我想你也需要像这样添加相应的类
sc._jsc.hadoopConfiguration().set("mapred.output.committer.class", "org.apache.hadoop.mapred.FileOutputCommitter")
示例片段:
sc = SparkContext()
sc._jsc.hadoopConfiguration().set("mapreduce.fileoutputcommitter.algorithm.version","2")
glueContext = GlueContext(sc)
spark = glueContext.spark_session
证明配置存在....
在 python 中调试:
sc._conf.getAll() // print this
在 scala 中调试:
sc.getConf.getAll.foreach(println)
选项 2:
你尝试使用胶水的作业参数的另一面:
https://docs.aws.amazon.com/glue/latest/dg/add-job.html 它具有文档中提到的键值属性
'--myKey' : 'value-for-myKey'
您可以按照下面的屏幕截图来编辑作业并使用 --conf
指定参数
选项 3:
如果您使用的是 aws cli,您可以在下面尝试...
https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
有趣的是,它们在文档dont set 消息中提到,如下所示。但不知道为什么会暴露。
To sum up : I personally prefer option1 since you have programmatic control.
关于scala - 将 Spark fileoutputcommitter.algorithm.version=2 与 AWS Glue 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56432696/