You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by devaraj-kavali <gi...@git.apache.org> on 2017/07/21 21:58:05 UTC

[GitHub] spark pull request #18708: [SPARK-21339] [CORE] spark-shell --packages optio...

GitHub user devaraj-kavali opened a pull request:

    https://github.com/apache/spark/pull/18708

    [SPARK-21339] [CORE] spark-shell --packages option does not add jars to classpath on windows

    ## What changes were proposed in this pull request?
    The --packages option jars are getting added to the classpath with the scheme as "file:///", in Unix it doesn't have problem with this since the scheme contains the Unix Path separator which separates the jar name with location in the classpath. In Windows, the jar file is not getting resolved from the classpath because of the scheme.
    
    Windows : file:///C:/Users/<user>/.ivy2/jars/<jar-name>.jar
    Unix : file:///home/<user>/.ivy2/jars/<jar-name>.jar
    
    With this PR, we are avoiding the 'file://' scheme to get added to the packages jar files.
    
    ## How was this patch tested?
    I have verified manually in Windows and Unix environments, with the change it adds the jar to classpath like below,
    
    Windows : C:\Users\<user>\.ivy2\jars\<jar-name>.jar
    Unix : /home/<user>/.ivy2/jars/<jar-name>.jar


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/devaraj-kavali/spark SPARK-21339

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18708.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18708
    
----
commit 3242532d4815fa9595dd9ca2d4d0b86c6d206ddb
Author: Devaraj K <de...@apache.org>
Date:   2017-07-21T21:51:46Z

    [SPARK-21339] [CORE] spark-shell --packages option does not add jars to
    classpath on windows

----


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by devaraj-kavali <gi...@git.apache.org>.
Github user devaraj-kavali commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    @vanzin I have updated the changes, can you check and validate the change? Thanks


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by quantkeyvis <gi...@git.apache.org>.
Github user quantkeyvis commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Hi, has this fix been implemented?


---

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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79888/
    Test PASSed.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    **[Test build #79954 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79954/testReport)** for PR 18708 at commit [`025e484`](https://github.com/apache/spark/commit/025e484f5fd768974910e24357d4d56b61b801e7).


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Merged build finished. Test PASSed.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    It's quite late in my local time so will take a closer look within coming few days but I hope @devaraj-kavali double checks this.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

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


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Merged build finished. Test PASSed.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    > If you are sure that it breaks the other user cases, 
    
    For one, `--jars file:/tmp/jars/*` will break with your change, since globs won't be resolved for `file` URLs.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by devaraj-kavali <gi...@git.apache.org>.
Github user devaraj-kavali commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Thanks @HyukjinKwon for checking this and for the link.
    
    > Are you saying "file:///C:/Users//.ivy2/jars/.jar" is not the correct form of URI on Windows?
    
    This URI form is correct for java.io.File and also for ClassLoader. I see that that the jar is getting loaded with this URI form from the ClassLoader during my inspection.
    
    SparkSubmit.scala
    
    ```
      private def addJarToClasspath(localJar: String, loader: MutableURLClassLoader) {
        val uri = Utils.resolveURI(localJar)
        uri.getScheme match {
          case "file" | "local" =>
            val file = new File(uri.getPath)
            if (file.exists()) {
              loader.addURL(file.toURI.toURL)
            } else {
    ```
    
    
    But this URI form is not supported by the `java -classpath`. In this below code, the `jars` are having the `file:///` scheme which is not supported and causing the issue.
    
    Main.scala
    
    ```
      private[repl] def doMain(args: Array[String], _interp: SparkILoop): Unit = {
        interp = _interp
        val jars = Utils.getUserJars(conf, isShell = true).mkString(File.pathSeparator)
        val interpArguments = List(
          "-Yrepl-class-based",
          "-Yrepl-outdir", s"${outputDir.getAbsolutePath}",
          "-classpath", jars
    ```
    
    And also we can see the difference with these java commands,
    
    In Windows,
    ```
    C:\>java -classpath file:///C:/work/test/a1.jar com.test.second.ClassZ
    Error: Could not find or load main class com.test.second.ClassZ
    
    C:\>java -classpath C:/work/test/a1.jar com.test.second.ClassZ
    From main method
    ```
    
    In Unix,
    
    ```
    [devaraj@devaraj-work-pc ~]$ java -classpath /home/devaraj/work/install/test/a1.jar com.test.second.ClassZ
    From main method
    
    [devaraj@devaraj-work-pc ~]$ java -classpath file:///home/devaraj/work/install/test/a1.jar com.test.second.ClassZ
    From main method
    ```



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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Can one of the admins verify this patch?


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    ok to test


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    > But this URI form is not supported by the java -classpath
    
    Then shouldn't the fix be in the code that transforms the URI list into an argument for `-classpath`?
    
    I'm pretty sure the code you're modifying in SparkSubmit will end up breaking other use cases.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Merging to master / 2.2. I'll fix a style nit while merging.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Actually, spotted something...


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79954/
    Test PASSed.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by devaraj-kavali <gi...@git.apache.org>.
Github user devaraj-kavali commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Thanks @vanzin for checking this.
    ```
    Then shouldn't the fix be in the code that transforms the URI list into an argument for -classpath?
    
    I'm pretty sure the code you're modifying in SparkSubmit will end up breaking other use cases.
    ```
    I thought this would be clean instead of adding the scheme file:/// for each jar and removing it before setting into the -classpath. I have verified the change in all deployment modes and I didn't see any issue. If you are sure that it breaks the other user cases, I will update the PR to remove the file:/// scheme from jars before setting into classpath.


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


[GitHub] spark pull request #18708: [SPARK-21339] [CORE] spark-shell --packages optio...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/18708


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    Thanks for cc'ing me @jiangxb1987.
    
    @devaraj-kavali, 
    
    >  In Windows, the jar file is not getting resolved from the classpath because of the scheme.
    
    Are you saying "file:///C:/Users//.ivy2/jars/.jar" is not the correct form of URI on Windows?
    
    ```scala
    scala> new java.io.File("C:\\Temp\\text.txt").exists
    res0: Boolean = true
    
    scala> new java.io.File(new java.net.URI("file:///C:/Temp/text.txt")).exists
    res1: Boolean = true
    ```
    
    I think that is also a correct form of URI on Windows - https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/
    
    I think the root cause is a different encoding resolution in Hadoop library. 


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by jiangxb1987 <gi...@git.apache.org>.
Github user jiangxb1987 commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    cc @HyukjinKwon Could you look at this PR please?


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    **[Test build #79954 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79954/testReport)** for PR 18708 at commit [`025e484`](https://github.com/apache/spark/commit/025e484f5fd768974910e24357d4d56b61b801e7).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #18708: [SPARK-21339] [CORE] spark-shell --packages option does ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18708
  
    **[Test build #79888 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79888/testReport)** for PR 18708 at commit [`3242532`](https://github.com/apache/spark/commit/3242532d4815fa9595dd9ca2d4d0b86c6d206ddb).


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