You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by re...@apache.org on 2023/08/02 07:45:12 UTC

[hbase-connectors] branch master updated: HBASE-27705: Respect SparkContext hadoop configuration (#114)

This is an automated email from the ASF dual-hosted git repository.

reidchan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase-connectors.git


The following commit(s) were added to refs/heads/master by this push:
     new 416e589  HBASE-27705: Respect SparkContext hadoop configuration (#114)
416e589 is described below

commit 416e589ea5dc5ac1a1b0ad17fe5d7658380e5d62
Author: Zhen Wang <64...@qq.com>
AuthorDate: Wed Aug 2 15:45:07 2023 +0800

    HBASE-27705: Respect SparkContext hadoop configuration (#114)
    
    Signed-off-by: Reid Chan <re...@apache.org>
---
 .../src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala b/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
index 0da7373..11702a0 100644
--- a/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
+++ b/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/DefaultSource.scala
@@ -130,7 +130,8 @@ case class HBaseRelation (
   val hbaseContext:HBaseContext = if (useHBaseContext) {
     LatestHBaseContextCache.latest
   } else {
-    val config = HBaseConfiguration.create()
+    val hadoopConfig = sqlContext.sparkContext.hadoopConfiguration
+    val config = HBaseConfiguration.create(hadoopConfig)
     configResources.map(resource => resource.split(",").foreach(r => config.addResource(r)))
     new HBaseContext(sqlContext.sparkContext, config)
   }