diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala index 779dc48ae6a..af6242ae1c7 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala @@ -84,22 +84,21 @@ class BatchJobSubmission( @VisibleForTesting private[kyuubi] val builder: ProcBuilder = { - Option(batchType).map(_.toUpperCase(Locale.ROOT)) match { - case Some("SPARK") | Some("PYSPARK") => - new SparkBatchProcessBuilder( - session.user, - session.sessionConf, - batchId, - batchName, - Option(resource), - className, - batchConf, - batchArgs, - getOperationLog) - - case _ => - throw new UnsupportedOperationException(s"Batch type $batchType unsupported") + val mainClass = Option(batchType).map(_.toUpperCase(Locale.ROOT)) match { + case Some("SPARK") => className + case Some("PYSPARK") => null + case _ => throw new UnsupportedOperationException(s"Batch type $batchType unsupported") } + new SparkBatchProcessBuilder( + session.user, + session.sessionConf, + batchId, + batchName, + Option(resource), + mainClass, + batchConf, + batchArgs, + getOperationLog) } override def currentApplicationInfo(): Option[ApplicationInfo] = {