Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-30126

sparkContext.addFile fails when file path contains spaces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.3
    • 3.0.0
    • PySpark
    • None

    Description

      When uploading a file to the spark context via the addFile function, an exception is thrown when file path contains a space character. Escaping the space with %20 or
      or + doesn't change the result.

       

      to reproduce: 

      file_path = "/home/user/test dir/config.conf"

      sparkContext.addFile(file_path)

       

      results in:

      py4j.protocol.Py4JJavaError: An error occurred while calling o131.addFile.
      : java.io.FileNotFoundException: File file:/home/user/test%20dir/config.conf does not exist

      Attachments

        Issue Links

          Activity

            People

              Ankitraj Ankit Raj Boudh
              Valendin Jan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: