Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14914] Normalize Paths/URIs for windows. - #12695
Conversation
Helping script for windows to download dependency and start zinc to support incremental building on windows.
When we pass absolute local path with drive label on windows to SparkContext's addFile, the scheme can't be correctly handled and it will cause a failure
AmplabJenkins
commented
Apr 26, 2016
Can one of the admins verify this patch? |
srowen
commented
Apr 26, 2016
@taoli91 please combine all your PRs into one and close the others. |
srowen
commented
Apr 26, 2016
Most of this PR is not the way to do it and adds lots of complexity. You're manually reimplementing a lot of logic in the JDK. |
taoli91
commented
Apr 26, 2016
@srowen Sure, I'll combine them into one. Could you elaborate more about what logic am I re-implementing? |
| case null | "local" => new File(path).getCanonicalFile.toURI.toString | ||
| case _ => path | ||
| } | ||
| val uri =Utils.resolveURI(path) |
There was a problem hiding this comment.
Maybe val uri = Utils.resolveURI(path)
srowen
commented
Apr 26, 2016
Broadly: you should be able to use the |
@srowen Double think about this problem, it seems the PR would be too large if combining into one. I personally believe that it's better to categorize the changes and separate them. |
srowen
commented
Apr 26, 2016
The problem is that discussion gets split across many threads, when the changes have a logical relationship. I see that they're mostly distinct threads of change in this case. Some of these may end up not being merged or in reduced form, which makes them more combine-able. For now, leave them to see where they go |
HyukjinKwon
commented
Apr 26, 2016
(@taoli91 FYI, it would be great if you run |
taoli91
commented
Apr 28, 2016
@HyukjinKwon Thanks for pointing out, I haven't noticed that there is an auto style check. Im going to have a vacation for a few days and I will fix them as soon as possible next week |
@srowen The regex parts are actually dealing with the URI. The default URI can't correctly handle the absolute Windows local path. It will recognize the drive label to be scheme. For example |
Isn't the URI just |
taoli91
commented
Apr 28, 2016
@srowen |
srowen
commented
Apr 28, 2016
Yes, I'm assuming all of the inputs need to be parseable as a URI in order to keep this sensible. At least, that seems less problematic than trying to accept inputs like |
vanzin
commented
Aug 4, 2016
avulanov
commented
Aug 5, 2016
@vanzin This PR partly addresses a broader problem that path construction is not consistent throughout Spark sources. Indeed, this is a potential source of bugs. Here is an example #13868 (comment). However, author addresses the problem with regex, which does not seem to be optimal as @srowen mentioned. I believe we should have a separate JIRA for making all path references and construction error-prone and consistent, and check everything including shell scripts. For example, https://github.com/apache/spark/blob/master/build/mvn#L161 contains a reference to |
srowen
commented
Aug 15, 2016
Let's close this PR |
steveloughran
commented
Aug 20, 2016
If you are working with windows paths; Hadoop's Path class contains the code to do this, stabilised and addressing the corner cases |
steveloughran
commented
Aug 20, 2016
As #13868 does adopt |
Closesapache#10995Closesapache#13658Closesapache#14505Closesapache#14536Closesapache#12753Closesapache#14449Closesapache#12694Closesapache#12695Closesapache#14810
What changes were proposed in this pull request?
The drive label and the back slash on windows' absolute path would confuse the URI scheme. This pull request mostly fix the path issue for windows.
How was this patch tested?
Unit tests