Skip to content

Commit 4fad75a

Browse files
committed
Add the Error infomation using spark-sql in yarn-cluster mode
1 parent bf1a6aa commit 4fad75a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ object SparkSubmit {
142142
printErrorAndExit("Cluster deploy mode is currently not supported for python applications.")
143143
case (_, CLUSTER) if isShell(args.primaryResource) =>
144144
printErrorAndExit("Cluster deploy mode is not applicable to Spark shells.")
145+
case (_, CLUSTER) if isSql(args.mainClass) =>
146+
printErrorAndExit("Cluster deploy mode is not applicable to Spark SQLs.")
145147
case _ =>
146148
}
147149

@@ -388,6 +390,13 @@ object SparkSubmit {
388390
primaryResource == SPARK_SHELL || primaryResource == PYSPARK_SHELL
389391
}
390392

393+
/**
394+
* Return whether the given main class represents a sql shell.
395+
*/
396+
private[spark] def isSql(mainClass: String): Boolean = {
397+
mainClass == "org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
398+
}
399+
391400
/**
392401
* Return whether the given primary resource requires running python.
393402
*/

0 commit comments

Comments
 (0)