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

    https://github.com/apache/spark/pull/18556#discussion_r126023986
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/source/libsvm/LibSVMRelation.scala ---
    @@ -89,18 +93,17 @@ private[libsvm] class LibSVMFileFormat extends 
TextBasedFileFormat with DataSour
           files: Seq[FileStatus]): Option[StructType] = {
         val libSVMOptions = new LibSVMOptions(options)
         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) {
    +      if (files.isEmpty) {
             throw new IOException("No input path specified for libsvm data")
    -      } else {
    -        throw new IOException("Multiple input paths are not supported for 
libsvm data.")
    +      } else if (files.length > 1) {
    +        logWarning(
    +          "Multiple input paths detected, determining the number of 
features by going " +
    --- End diff --
    
    Good. How about warning only if `numFeature` is missing? I mean, remove the 
condition `files.length > 1`
    
    ```scala
    if (files.isEmpty) { }
    else { ... logWarning ...}
    ```


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

Reply via email to