-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-21339] [CORE] spark-shell --packages option does not add jars to classpath on windows #18708
Conversation
classpath on windows
ok to test |
cc @HyukjinKwon Could you look at this PR please? |
Thanks for cc'ing me @jiangxb1987.
Are you saying "file:///C:/Users//.ivy2/jars/.jar" is not the correct form of URI on Windows? 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 sounds a different encoding resolution in Hadoop library or somewhere. |
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. |
Test build #79888 has finished for PR 18708 at commit
|
Thanks @HyukjinKwon for checking this and for the link.
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
But this URI form is not supported by the Main.scala
And also we can see the difference with these java commands, In Windows,
In Unix,
|
Then shouldn't the fix be in the code that transforms the URI list into an argument for I'm pretty sure the code you're modifying in SparkSubmit will end up breaking other use cases. |
Thanks @vanzin for checking this.
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. |
For one, |
Test build #79954 has finished for PR 18708 at commit
|
@vanzin I have updated the changes, can you check and validate the change? Thanks |
Merging to master / 2.2. I'll fix a style nit while merging. |
…o classpath on windows 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. 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 Author: Devaraj K <devaraj@apache.org> Closes #18708 from devaraj-kavali/SPARK-21339. (cherry picked from commit 58da1a2) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
Hi, has this fix been implemented? (In any of the currently released versions) |
…o classpath on windows 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. 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 Author: Devaraj K <devaraj@apache.org> Closes apache#18708 from devaraj-kavali/SPARK-21339. (cherry picked from commit 58da1a2) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
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//.ivy2/jars/.jar
Unix : file:///home//.ivy2/jars/.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//.ivy2/jars/.jar