You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/06/28 12:55:06 UTC
[GitHub] [spark] martin-g commented on a diff in pull request #37016: Driver cores mult be a positive number fix
martin-g commented on code in PR #37016:
URL: https://github.com/apache/spark/pull/37016#discussion_r908444889
##########
core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala:
##########
@@ -253,7 +253,7 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
&& Try(JavaUtils.byteStringAsBytes(executorMemory)).getOrElse(-1L) <= 0) {
error("Executor memory must be a positive number")
}
- if (driverCores != null && Try(driverCores.toInt).getOrElse(-1) <= 0) {
+ if (driverCores != null && Try(driverCores.toDouble.toInt).getOrElse(-1) <= 0) {
error("Driver cores must be a positive number")
Review Comment:
IMO this should be improved properly by pattern matching on the `Try` and printing the actual `Failure`.
Not just for `driverCores` but for all input arguments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org