HyukjinKwon commented on code in PR #37262:
URL: https://github.com/apache/spark/pull/37262#discussion_r928379125
##########
core/src/main/scala/org/apache/spark/internal/io/SparkHadoopWriter.scala:
##########
@@ -339,7 +339,8 @@ class HadoopMapReduceWriteConfigUtil[K, V: ClassTag](conf:
SerializableConfigura
override def createCommitter(jobId: Int): HadoopMapReduceCommitProtocol = {
FileCommitProtocol.instantiate(
- className = classOf[HadoopMapReduceCommitProtocol].getName,
+ className = getConf.get("mapreduce.sources.commitProtocolClass",
Review Comment:
One workaround might be:
```scala
val config = new HadoopMapReduceWriteConfigUtil[K, V](new
SerializableConfiguration(conf)) {
override def createCommitter(jobId: Int):
HadoopMapReduceCommitProtocol = {
FileCommitProtocol.instantiate(
className = "CustomClassName",
jobId = jobId.toString,
outputPath = new SerializableConfiguration(
conf).value.get("mapreduce.output.fileoutputformat.outputdir")
).asInstanceOf[HadoopMapReduceCommitProtocol]
}
}
SparkHadoopWriter.write(
rdd = self,
config = config)
```
Although `HadoopMapReduceWriteConfigUtil` would have to be inherited within
`org.apache.spark` package in your project though (if you're using Scala). For
Java, it won't validate the package name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]