[KYUUBI-219]Fix NPE in HiveTokenCollector (#220)

This commit is contained in:
Kent Yao 2019-10-23 16:02:23 +08:00 committed by GitHub
parent 191b8171d6
commit c6ef20089e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ private[security] object HiveTokenCollector extends TokenCollector with Logging
val currentUser = UserGroupInformation.getCurrentUser.getUserName
val credentials = new Credentials()
KyuubiHadoopUtil.doAsRealUser {
val hive = Hive.get(c, classOf[HiveConf])
val hive = Hive.get(c, true)
info(s"Getting token from Hive Metastore for owner $currentUser via $principal")
val tokenString = hive.getDelegationToken(currentUser, principal)
val token = new Token[DelegationTokenIdentifier]