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 2020/09/08 07:01:44 UTC

[GitHub] [spark] MaxGekk opened a new pull request #29670: [SPARK-32815][MLlib] Fix LibSVM data source loading error on file paths with glob metacharacters

MaxGekk opened a new pull request #29670:
URL: https://github.com/apache/spark/pull/29670


   ### What changes were proposed in this pull request?
   In the PR, I propose to fix an issue with LibSVM datasource when both of the following are true:
   * no user specified schema
   * some file paths contain escaped glob metacharacters, such as `[``]`, `{``}`, `*` etc.
   
   The fixe is based on another bug fix for CSV/JSON datasources https://github.com/apache/spark/pull/29659.
   
   ### Why are the changes needed?
   To fix the issue when the follow two queries try to read from paths `[abc]`:
   ```scala
   spark.read.format("libsvm").load("""/tmp/\[abc\].csv""").show
   ```
   but would end up hitting an exception:
   ```
   Path does not exist: file:/private/var/folders/p3/dfs6mf655d7fnjrsjvldh0tc0000gn/T/spark-6ef0ae5e-ff9f-4c4f-9ff4-0db3ee1f6a82/[abc]/part-00000-26406ab9-4e56-45fd-a25a-491c18a05e76-c000.libsvm;
   org.apache.spark.sql.AnalysisException: Path does not exist: file:/private/var/folders/p3/dfs6mf655d7fnjrsjvldh0tc0000gn/T/spark-6ef0ae5e-ff9f-4c4f-9ff4-0db3ee1f6a82/[abc]/part-00000-26406ab9-4e56-45fd-a25a-491c18a05e76-c000.libsvm;
   	at org.apache.spark.sql.execution.datasources.DataSource$.$anonfun$checkAndGlobPathIfNecessary$3(DataSource.scala:770)
   	at org.apache.spark.util.ThreadUtils$.$anonfun$parmap$2(ThreadUtils.scala:373)
   	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
   	at scala.util.Success.$anonfun$map$1(Try.scala:255)
   	at scala.util.Success.map(Try.scala:213)
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   
   ### How was this patch tested?
   Added UT to `LibSVMRelationSuite`.


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



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


[GitHub] [spark] cloud-fan closed pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #29670:
URL: https://github.com/apache/spark/pull/29670


   


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



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


[GitHub] [spark] SparkQA commented on pull request #29670: [SPARK-32815][MLlib] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688666305


   **[Test build #128384 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128384/testReport)** for PR 29670 at commit [`27e8269`](https://github.com/apache/spark/commit/27e8269da2dbda80434165c727e058021e2d5e58).


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



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29670: [SPARK-32815][MLlib] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688662744






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



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


[GitHub] [spark] cloud-fan commented on a change in pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29670:
URL: https://github.com/apache/spark/pull/29670#discussion_r484857152



##########
File path: mllib/src/main/scala/org/apache/spark/ml/source/libsvm/LibSVMRelation.scala
##########
@@ -100,7 +100,7 @@ private[libsvm] class LibSVMFileFormat
         "though the input. If you know the number in advance, please specify it via " +
         "'numFeatures' option to avoid the extra scan.")
 
-      val paths = files.map(_.getPath.toUri.toString)

Review comment:
       is this change related?




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



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


[GitHub] [spark] MaxGekk commented on pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688761184


   Here are backports for:
   - 3.0 https://github.com/apache/spark/pull/29675
   - 2.4 https://github.com/apache/spark/pull/29678
   
   FYI, the patch could be merged clearly but build will fail due to a missing function.


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



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


[GitHub] [spark] cloud-fan commented on pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688905798


   thanks, merging to master!


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



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688711452






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



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


[GitHub] [spark] SparkQA commented on pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688710890


   **[Test build #128384 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128384/testReport)** for PR 29670 at commit [`27e8269`](https://github.com/apache/spark/commit/27e8269da2dbda80434165c727e058021e2d5e58).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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



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


[GitHub] [spark] MaxGekk commented on a change in pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #29670:
URL: https://github.com/apache/spark/pull/29670#discussion_r484909140



##########
File path: mllib/src/main/scala/org/apache/spark/ml/source/libsvm/LibSVMRelation.scala
##########
@@ -100,7 +100,7 @@ private[libsvm] class LibSVMFileFormat
         "though the input. If you know the number in advance, please specify it via " +
         "'numFeatures' option to avoid the extra scan.")
 
-      val paths = files.map(_.getPath.toUri.toString)

Review comment:
       `getPath.toUri` do some escape on special characters, which break the case of path with glob metacharacters.




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



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


[GitHub] [spark] AmplabJenkins commented on pull request #29670: [SPARK-32815][MLlib] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688662744






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



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


[GitHub] [spark] MaxGekk commented on pull request #29670: [SPARK-32815][MLlib] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688663771


   Thanks to @WeichenXu123 for the provided fix and the test. @HyukjinKwon @cloud-fan Please, review this PR. I am checking that the changes don't conflict with 3.0/2.4 branches and the bug exists there.


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



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


[GitHub] [spark] AmplabJenkins commented on pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688711452






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



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


[GitHub] [spark] SparkQA removed a comment on pull request #29670: [SPARK-32815][ML] Fix LibSVM data source loading error on file paths with glob metacharacters

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29670:
URL: https://github.com/apache/spark/pull/29670#issuecomment-688666305


   **[Test build #128384 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128384/testReport)** for PR 29670 at commit [`27e8269`](https://github.com/apache/spark/commit/27e8269da2dbda80434165c727e058021e2d5e58).


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



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