"Managed Service for Apache Spark" is the new name for the product formerly known as "Dataproc on Compute Engine" (cluster deployment) and "Google Cloud Serverless for Apache Spark" (serverless deployment).
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
发送反馈
使用 DataprocFileOutputCommitter 运行 Spark 作业
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
DataprocFileOutputCommitter 功能是开源 FileOutputCommitter 的增强版。它支持 Apache Spark 作业并发写入输出位置。
限制
DataprocFileOutputCommitter 功能支持在使用以下映像版本创建的 Managed Service for Apache Spark Compute Engine 集群上运行的 Spark 作业:
2.1 映像版本 2.1.10 及更高版本
2.0 版映像版本 2.0.62 及更高版本
使用 DataprocFileOutputCommitter
要使用此功能,请执行以下操作:
创建 Managed Service for Apache Spark on Compute Engine 集群
使用映像版本 2.1.10 或 2.0.62 或更高版本。
在向集群提交 Spark 作业时,将 spark.hadoop.mapreduce.outputcommitter.factory.class=org.apache.hadoop.mapreduce.lib.output.DataprocFileOutputCommitterFactory 和 spark.hadoop.mapreduce.fileoutputcommitter.marksuccessfuljobs=false
设置为作业属性。
gcloud dataproc jobs submit spark \
--properties=spark.hadoop.mapreduce.outputcommitter.factory.class=org.apache.hadoop.mapreduce.lib.output.DataprocFileOutputCommitterFactory,spark.hadoop.mapreduce.fileoutputcommitter.marksuccessfuljobs=false \
--region=REGION \
other args ...
sc.hadoopConfiguration.set("spark.hadoop.mapreduce.outputcommitter.factory.class","org.apache.hadoop.mapreduce.lib.output.DataprocFileOutputCommitterFactory")
sc.hadoopConfiguration.set("spark.hadoop.mapreduce.fileoutputcommitter.marksuccessfuljobs","false")
Managed Service for Apache Spark 文件输出提交器必须设置 spark.hadoop.mapreduce.fileoutputcommitter.marksuccessfuljobs=false,以避免在并发写入期间创建的成功标记文件之间发生冲突。
您也可以在 spark-defaults.conf 中设置此属性。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-06-03。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-06-03。"],[],[]]