Skip to content

Commit

Permalink
Merge pull request #134 from yaooqinn/KYUUBI-133
Browse files Browse the repository at this point in the history
[KYUUBI-133]fix #133 token expiration in HadoopRDD getPartitions
  • Loading branch information
yaooqinn authored Dec 20, 2018
2 parents e960540 + 203f615 commit 6fbc4b4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ object KyuubiSparkUtil extends Logging {
val HDFS_CLIENT_CACHE_DEFAULT = "true"
val FILE_CLIENT_CACHE: String = SPARK_HADOOP_PREFIX + "fs.file.impl.disable.cache"
val FILE_CLIENT_CACHE_DEFAULT = "true"
val RDD_PAR_LISTING: String = SPARK_PREFIX + "rdd.parallelListingThreshold"

// Runtime Spark Version
val SPARK_VERSION: String = org.apache.spark.SPARK_VERSION
Expand Down Expand Up @@ -282,6 +283,14 @@ object KyuubiSparkUtil extends Logging {
if (UserGroupInformation.isSecurityEnabled) {
conf.setIfMissing(HDFS_CLIENT_CACHE, HDFS_CLIENT_CACHE_DEFAULT)
conf.setIfMissing(FILE_CLIENT_CACHE, FILE_CLIENT_CACHE_DEFAULT)
// If you are using Kyuubi against kerberized HDFS, you will run into HDFS_DELEGATION_TOKEN
// expiration in some particular sql queries. This exception is usually caught in
// HadoopRDD.getPartitions, where the JobConf has no Credentials because it is generated by
// Configuration, and the UGI.getCurrentUser contains only the oldest tokens which are
// destined to expire. The reason seems to be parallel listing UnionRDD's sub RDDs using a
// ForkJoinPool which points to another calling context. Turn off parallel listing seems
// to be a solution to this issue.
conf.setIfMissing(RDD_PAR_LISTING, Int.MaxValue.toString)
}
}

Expand Down

0 comments on commit 6fbc4b4

Please sign in to comment.