我还没有弄清楚这一点,但我正在尝试使用AWS Glue的直接输出提交者:
spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2
是否可以将此配置与AWS Glue一起使用?
发布于 2019-06-04 02:59:27
选项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
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
有趣的是,他们在文档中提到,不要像下面这样设置消息。
总结:我个人更喜欢option1,因为你有编程控制。
发布于 2019-06-05 16:20:19
进入胶水作业控制台,按如下所示编辑您的作业:
Glue>作业>编辑Job>脚本库和作业参数(可选)>作业参数
设置以下内容:
密钥:--conf值:
spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2
https://stackoverflow.com/questions/56432696
复制相似问题