You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/06/14 06:32:10 UTC

[GitHub] [spark] mengxr commented on a change in pull request #24830: [SPARK-27990][SQL][ML][WIP] Provide a way to recursively load data from datasource

mengxr commented on a change in pull request #24830: [SPARK-27990][SQL][ML][WIP] Provide a way to recursively load data from datasource
URL: https://github.com/apache/spark/pull/24830#discussion_r292077612
 
 

 ##########
 File path: mllib/src/test/scala/org/apache/spark/ml/source/image/ImageFileFormatSuite.scala
 ##########
 @@ -104,6 +105,30 @@ class ImageFileFormatSuite extends SparkFunSuite with MLlibTestSparkContext {
     assert(firstBytes20Set === expectedFirstBytes20Set)
   }
 
+  test("recursive loading") {
+    val imagesPath = spark.read.format("image")
+      .option("dropInvalid", true)
+      .option("recursive", true)
+      .load(recursiveImagePath)
+      .select(col("image.origin"))
+      .collect()
+      .map { row =>
+        val path = row.getString(0)
+        val keyStr = "images/recursive/"
+        path.substring(path.indexOf(keyStr) + keyStr.length)
+      }
+    assert(Set(imagesPath: _*) === Set(
+      "multi-channel/chr30.4.184.jpg",
 
 Review comment:
   Could you use existing files or create new files from the test? Checking in binary files is generally not good.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org