You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by HyukjinKwon <gi...@git.apache.org> on 2017/07/06 09:09:13 UTC

[GitHub] spark pull request #18288: [SPARK-21066][ML] LibSVM load just one input file

Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18288#discussion_r125848152
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/source/libsvm/LibSVMRelation.scala ---
    @@ -91,12 +91,10 @@ private[libsvm] class LibSVMFileFormat extends TextBasedFileFormat with DataSour
         val numFeatures: Int = libSVMOptions.numFeatures.getOrElse {
           // Infers number of features if the user doesn't specify (a valid) one.
           val dataFiles = files.filterNot(_.getPath.getName startsWith "_")
    -      val path = if (dataFiles.length == 1) {
    -        dataFiles.head.getPath.toUri.toString
    -      } else if (dataFiles.isEmpty) {
    +      val path = if (dataFiles.isEmpty) {
             throw new IOException("No input path specified for libsvm data")
           } else {
    -        throw new IOException("Multiple input paths are not supported for libsvm data.")
    +        dataFiles.map(_.getPath.toUri.toString).mkString(",")
    --- End diff --
    
    Sorry for interrupting but I believe I am working on an issue around this code path - https://issues.apache.org/jira/browse/SPARK-21326
    
    Could we allow multiple paths and print warning maybe? I think it'd be similar ones with JSON/CSV schema inferences. These are also, up to my knowledge, discouraged in production but I we allow it with full scan. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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