WeichenXu123 commented on a change in pull request #24830:
[SPARK-27990][SQL][ML] Provide a way to recursively load data from datasource
URL: https://github.com/apache/spark/pull/24830#discussion_r295114258
##########
File path:
mllib/src/test/scala/org/apache/spark/ml/source/image/ImageFileFormatSuite.scala
##########
@@ -104,6 +105,39 @@ class ImageFileFormatSuite extends SparkFunSuite with
MLlibTestSparkContext {
assert(firstBytes20Set === expectedFirstBytes20Set)
}
+ test("recursive loading") {
+ val imagesPath = spark.read.format("image")
+ .option("dropInvalid", true)
+ .option("recursiveFileLookup", true)
+ .load(recursiveImagePath)
+ .select(col("image.origin"))
+ .collect()
+ .map { row =>
+ val path = row.getString(0)
+ val keyStr = "data/mllib/images/"
+ path.substring(path.indexOf(keyStr) + keyStr.length)
+ }
+
+ assert(Set(imagesPath: _*) === Set(
Review comment:
@gengliangwang What about remove the testcase in `ImageFileFormatSuite` ?
The test in `FileBasedDatasourceSuite` is enough.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]