I tried in spark client mode, spark-submit can get the correct return code from spark job. But in yarn-cluster mode, It failed.
From: lin_q...@outlook.com To: u...@spark.incubator.apache.org Subject: Issue on [SPARK-3877][YARN]: Return code of the spark-submit in yarn-cluster mode Date: Fri, 5 Dec 2014 16:55:37 +0800 Hi, all: According to https://github.com/apache/spark/pull/2732, When a spark job fails or exits nonzero in yarn-cluster mode, the spark-submit will get the corresponding return code of the spark job. But I tried in spark-1.1.1 yarn cluster, spark-submit return zero anyway. Here is my spark code: try { val dropTable = s"drop table $DB.$tableName" hiveContext.hql(dropTable) val createTbl = do some thing... hiveContext.hql(createTbl) } catch { case ex: Exception => { Util.printLog("ERROR", s"create db error.") exit(-1) } } Maybe I did something wrong. Is there any hint? Thanks.