dongjoon-hyun commented on code in PR #37262:
URL: https://github.com/apache/spark/pull/37262#discussion_r928184360


##########
core/src/test/scala/org/apache/spark/FileSuite.scala:
##########
@@ -485,6 +486,23 @@ class FileSuite extends SparkFunSuite with 
LocalSparkContext {
     assert(new File(tempDir.getPath + 
"/outputDataset_new/part-r-00000").exists())
   }
 
+  test ("SPARK-38102: save Hadoop Dataset through new Hadoop API with 
commitProtocolClass option") {
+    sc = new SparkContext("local", "test")
+    val randomRDD = sc.parallelize(
+      Seq(("key1", "a"), ("key2", "a"), ("key3", "b"), ("key4", "c")), 1)
+    val job = Job.getInstance(sc.hadoopConfiguration)
+    job.setOutputKeyClass(classOf[String])
+    job.setOutputValueClass(classOf[String])
+    job.setOutputFormatClass(classOf[NewTextOutputFormat[String, String]])
+    val jobConfig = job.getConfiguration
+    jobConfig.set("mapreduce.output.fileoutputformat.outputdir",
+      tempDir.getPath + "/outputDataset_new")
+    jobConfig.set("mapreduce.sources.commitProtocolClass",
+      classOf[HadoopMapReduceCommitProtocol].getName)

Review Comment:
   Does this test case fail without your patch? If not, this is invalid.



-- 
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]

Reply via email to