You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2020/07/27 19:04:00 UTC
[jira] [Resolved] (SPARK-32443) Fix testCommandAvailable to use
POSIX compatible `command -v`
[ https://issues.apache.org/jira/browse/SPARK-32443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dongjoon Hyun resolved SPARK-32443.
-----------------------------------
Fix Version/s: 3.1.0
Resolution: Fixed
Issue resolved by pull request 29241
[https://github.com/apache/spark/pull/29241]
> Fix testCommandAvailable to use POSIX compatible `command -v`
> -------------------------------------------------------------
>
> Key: SPARK-32443
> URL: https://issues.apache.org/jira/browse/SPARK-32443
> Project: Spark
> Issue Type: Sub-task
> Components: Spark Core
> Affects Versions: 2.1.3, 2.2.3, 2.3.4, 2.4.6, 3.0.0
> Reporter: Dongjoon Hyun
> Assignee: Dongjoon Hyun
> Priority: Major
> Fix For: 3.1.0
>
>
> Currently, we run the command to check the existence. This is dangerous and doesn't work sometimes.
> {code}
> scala> sys.process.Process("cat").run().exitValue()
> res0: Int = 0
> scala> sys.process.Process("ls").run().exitValue()
> LICENSE
> NOTICE
> bin
> doc
> lib
> man
> res1: Int = 0
> scala> sys.process.Process("rm").run().exitValue()
> usage: rm [-f | -i] [-dPRrvW] file ...
> unlink file
> res4: Int = 64
> {code}
> {code}
> scala> sys.process.Process("command -v rm").run().exitValue()
> /bin/rm
> res5: Int = 0
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org