Compare commits
7 Commits
master
...
branch-0.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2da63e8e1 | ||
|
|
e05cc67e96 | ||
|
|
c327b08395 | ||
|
|
0f03f35b0a | ||
|
|
01e27e573e | ||
|
|
d97a4d7369 | ||
|
|
f3b3f20bf4 |
@ -22,7 +22,7 @@
|
||||
<parent>
|
||||
<artifactId>kyuubi</artifactId>
|
||||
<groupId>yaooqinn</groupId>
|
||||
<version>0.5.0</version>
|
||||
<version>0.5.3-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -387,25 +387,28 @@ class KyuubiOperation(session: KyuubiSession, statement: String) extends Logging
|
||||
}
|
||||
case e: ParseException =>
|
||||
if (!isClosedOrCanceled) {
|
||||
onStatementError(
|
||||
statementId, e.withCommand(statement).getMessage, KyuubiSparkUtil.exceptionString(e))
|
||||
val err = KyuubiSparkUtil.exceptionString(e)
|
||||
onStatementError(statementId, e.withCommand(statement).getMessage, err)
|
||||
throw new KyuubiSQLException(
|
||||
e.withCommand(statement).getMessage, "ParseException", 2000, e)
|
||||
e.withCommand(statement).getMessage + err, "ParseException", 2000, e)
|
||||
}
|
||||
case e: AnalysisException =>
|
||||
if (!isClosedOrCanceled) {
|
||||
onStatementError(statementId, e.getMessage, KyuubiSparkUtil.exceptionString(e))
|
||||
throw new KyuubiSQLException(e.getMessage, "AnalysisException", 2001, e)
|
||||
val err = KyuubiSparkUtil.exceptionString(e)
|
||||
onStatementError(statementId, e.getMessage, err)
|
||||
throw new KyuubiSQLException(err, "AnalysisException", 2001, e)
|
||||
}
|
||||
case e: HiveAccessControlException =>
|
||||
if (!isClosedOrCanceled) {
|
||||
onStatementError(statementId, e.getMessage, KyuubiSparkUtil.exceptionString(e))
|
||||
throw new KyuubiSQLException(e.getMessage, "HiveAccessControlException", 3000, e)
|
||||
val err = KyuubiSparkUtil.exceptionString(e)
|
||||
onStatementError(statementId, e.getMessage, err)
|
||||
throw new KyuubiSQLException(err, "HiveAccessControlException", 3000, e)
|
||||
}
|
||||
case e: Throwable =>
|
||||
if (!isClosedOrCanceled) {
|
||||
onStatementError(statementId, e.getMessage, KyuubiSparkUtil.exceptionString(e))
|
||||
throw new KyuubiSQLException(e.toString, "<unknown>", 10000, e)
|
||||
val err = KyuubiSparkUtil.exceptionString(e)
|
||||
onStatementError(statementId, e.getMessage, err)
|
||||
throw new KyuubiSQLException(err, "<unknown>", 10000, e)
|
||||
}
|
||||
} finally {
|
||||
if (statementId != null) {
|
||||
|
||||
@ -137,15 +137,6 @@ private[kyuubi] class KyuubiSession(
|
||||
}
|
||||
}
|
||||
|
||||
private def cleanupSessionResourcesDir(): Unit = {
|
||||
try {
|
||||
FileUtils.forceDelete(sessionResourcesDir)
|
||||
} catch {
|
||||
case e: Exception =>
|
||||
error("Failed to cleanup session log dir: " + sessionResourcesDir, e)
|
||||
}
|
||||
}
|
||||
|
||||
def sparkSession: SparkSession = this.sparkSessionWithUGI.sparkSession
|
||||
|
||||
def ugi: UserGroupInformation = this.sessionUGI
|
||||
@ -205,8 +196,6 @@ private[kyuubi] class KyuubiSession(
|
||||
// Iterate through the opHandles and close their operations
|
||||
opHandleSet.foreach(closeOperation)
|
||||
opHandleSet.clear()
|
||||
// Cleanup session resources directory
|
||||
cleanupSessionResourcesDir()
|
||||
// Cleanup session log directory.
|
||||
cleanupSessionLogDir()
|
||||
} finally {
|
||||
|
||||
@ -178,8 +178,17 @@ class SparkSessionWithUGI(
|
||||
}
|
||||
}
|
||||
stopContext()
|
||||
val ke = new KyuubiSQLException(
|
||||
s"Get SparkSession for [$userName] failed", "08S01", 1001, findCause(e))
|
||||
val cause = findCause(e)
|
||||
val msg =
|
||||
s"""
|
||||
|Get SparkSession for [$userName] failed
|
||||
|Diagnosis:
|
||||
|${sparkException.map(_.getMessage).getOrElse(cause.getMessage)}
|
||||
|
|
||||
|Please check if the specified yarn queue [${conf.getOption(QUEUE).getOrElse("")}]
|
||||
|is available or has sufficient resources left
|
||||
""".stripMargin
|
||||
val ke = new KyuubiSQLException(msg, "08S01", 1001, cause)
|
||||
sparkException.foreach(ke.addSuppressed)
|
||||
throw ke
|
||||
} finally {
|
||||
|
||||
@ -153,7 +153,7 @@ class SparkSessionWithUGISuite extends SparkFunSuite {
|
||||
assert(!SparkSessionWithUGI.isPartiallyConstructed(userName1))
|
||||
val e = intercept[KyuubiSQLException](sparkSessionWithUGI.init(Map.empty))
|
||||
assert(e.getCause.isInstanceOf[TimeoutException])
|
||||
assert(e.getMessage.startsWith("Get SparkSession"))
|
||||
assert(e.getMessage.contains("Get SparkSession"))
|
||||
}
|
||||
|
||||
test("testSetFullyConstructed") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user