Skip to content

Commit

Permalink
[KYUUBI-133]fix #133 token expiration in HadoopRDD getPartitions
Browse files Browse the repository at this point in the history
  • Loading branch information
yaooqinn committed Dec 13, 2018
1 parent e960540 commit 4b7f2c5
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import scala.util.control.NonFatal
import org.apache.hadoop.hive.conf.HiveConf
import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAccessControlException
import org.apache.hadoop.hive.ql.session.OperationLog
import org.apache.hadoop.mapred.JobConf
import org.apache.hive.service.cli.thrift.TProtocolVersion
import org.apache.spark.KyuubiConf._
import org.apache.spark.KyuubiSparkUtil
Expand All @@ -40,6 +41,7 @@ import yaooqinn.kyuubi.cli.FetchOrientation
import yaooqinn.kyuubi.schema.{RowSet, RowSetBuilder}
import yaooqinn.kyuubi.session.KyuubiSession
import yaooqinn.kyuubi.ui.KyuubiServerMonitor
import yaooqinn.kyuubi.utils.ReflectUtils

class KyuubiOperation(session: KyuubiSession, statement: String) extends Logging {

Expand Down Expand Up @@ -313,6 +315,10 @@ class KyuubiOperation(session: KyuubiSession, statement: String) extends Logging
statementId,
session.getUserName)
}
val hadoopConf = session.sparkSession.sparkContext.hadoopConfiguration
val jobConf = new JobConf(hadoopConf)
jobConf.setCredentials(session.ugi.getCredentials)
ReflectUtils.setFieldValue(session.sparkSession.sparkContext, "_hadoopConfiguration", jobConf)
session.sparkSession.sparkContext.setJobGroup(statementId, statement)
result = session.sparkSession.sql(statement)
KyuubiServerMonitor.getListener(session.getUserName).foreach {
Expand Down

0 comments on commit 4b7f2c5

Please sign in to comment.