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-21877][DEPLOY, WINDOWS] Handle quotes in Windows command scripts #19090
Conversation
ok to test |
Looks ok given the examples & syntax - https://ss64.com/nt/cmd.html and https://technet.microsoft.com/en-us/library/cc771320(v=ws.11).aspx and my manual tests. I think here is the very entry point to Windows users. So, will take a closer look few times more. Meanwhile, @minixalpha would you mind if I ask check if there are any potential corner cases that might not work as well? |
Test build #81305 has finished for PR 19090 at commit
|
@HyukjinKwon Thanks for your review! Should I provide more test cases to cover the potential corner cases? |
I believe that would make this PR much more persuasive. |
ok, I will give more test cases later. |
I design two groups test cases:
All these test cases works well. Environment
Test cases about windows command scripts optionsAll these test cases take No option
Has optionsOne optionOption has no parameter
Option has parameterOption parameter has no quotes
Option parameter has quotes
Multi optionsall options has no quotes
some options has no quotes
all options has quotes
Examples in Spark document
@HyukjinKwon According to the result of these test cases, I think this PR can works well in different situations, anything else should be tested ? |
Thanks for thorough testing. Yea, looks fine. Will take a look few times more by myself. |
@jsnowacki, would you mind if I ask double check this PR when you have some time? |
I've also tested the solution and, indeed, it works as intended, though, I never seen a complaint about this, as people tend to omit quotes, not the other way around. Also, the changes looks right and they are well motivated. The only thing I'd suggest is adding a comment about the quotes, for someone to not optimize them out in the future. |
@jsnowacki Thanks for reviewing this PR! There are some situations people cannot omit the quotes, such as multiple parameters of "--driver-java-options". For example: passing multiple -D arguments to driver-java-options in spark-submit on windows Actually, I find this bug when I try to start a Spark interpreter in Apache Zeppelin. When SPARK_HOME is set, Zeppelin will add some options to spark-submit, in these options, there are some quotes, which trigger this bug in Windows. I trace the launch process of Spark interpreter and finally I found that it is a bug of Spark. Without this bugfix, Zeppelin cannot start Spark interpreter when SPARK_HOME is set on Windows. I will add some comments about these quotes. |
Test build #82385 has finished for PR 19090 at commit
|
Test build #82386 has finished for PR 19090 at commit
|
Test build #82387 has finished for PR 19090 at commit
|
@jsnowacki I have already add comments to explain the quotes, could you help me review the comments? Thanks. |
I think the comments are fine and sufficiently explain extra quotes existence. |
Thanks for reviewing @jsnowacki, let me try to take a final look. I also checked what I could all but let me double check. Just want to be careful as it's the entry point. |
@felixcheung, this one LGTM as I checked what I could all and quite confident; however, will leave this open for few days more considering importance. Let me please cc you here to double check when you have some times or leave some comments if you have some concerns. |
Tested this, looks good to me
|
Merged to master. |
Thanks, @HyukjinKwon @jsnowacki @felixcheung |
What changes were proposed in this pull request?
All the windows command scripts can not handle quotes in parameter.
Run a windows command shell with parameter which has quotes can reproduce the bug:
Windows recognize "--driver-java-options" as part of the command.
All the Windows command script has the following code have the bug.
We should quote command and parameters like
How was this patch tested?
Test manually on Windows 10 and Windows 7
We can verify it by the following demo:
With the spark-shell.cmd example, change it to the following code will make the command execute succeed.