Github user WeichenXu123 commented on a diff in the pull request: https://github.com/apache/spark/pull/18872#discussion_r133082255 --- Diff: mllib/src/test/scala/org/apache/spark/ml/source/libsvm/LibSVMRelationSuite.scala --- @@ -109,14 +112,15 @@ class LibSVMRelationSuite extends SparkFunSuite with MLlibTestSparkContext { test("write libsvm data and read it again") { val df = spark.read.format("libsvm").load(path) val tempDir2 = new File(tempDir, "read_write_test") - val writepath = tempDir2.toURI.toString + val writePath = tempDir2.toURI.toString // TODO: Remove requirement to coalesce by supporting multiple reads. - df.coalesce(1).write.format("libsvm").mode(SaveMode.Overwrite).save(writepath) + df.coalesce(1).write.format("libsvm").mode(SaveMode.Overwrite).save(writePath) - val df2 = spark.read.format("libsvm").load(writepath) + val df2 = spark.read.format("libsvm").load(writePath) val row1 = df2.first() val v = row1.getAs[SparseVector](1) assert(v == Vectors.sparse(6, Seq((0, 1.0), (2, 2.0), (4, 3.0)))) + Utils.deleteRecursively(tempDir2) --- End diff -- You can remove this cleanup I think. The test framework will clean temp dir automatically I think.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org