You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ng...@apache.org on 2019/01/31 16:32:34 UTC

[hive] branch master updated: HIVE-20484: Disable Block Cache By Default With HBase SerDe (Beluga Behr, reviewed by Prashant J and Naveen Gangam)

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

ngangam pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 5634140  HIVE-20484: Disable Block Cache By Default With HBase SerDe (Beluga Behr, reviewed by Prashant J and Naveen Gangam)
5634140 is described below

commit 5634140b2beacdac20ceec8c73ff36bce5675ef8
Author: Naveen Gangam <ng...@apache.org>
AuthorDate: Thu Jan 31 11:32:08 2019 -0500

    HIVE-20484: Disable Block Cache By Default With HBase SerDe (Beluga Behr, reviewed by Prashant J and Naveen Gangam)
---
 .../java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java   | 6 ++----
 .../org/apache/hadoop/hive/hbase/HiveHBaseInputFormatUtil.java   | 9 +++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
index 8c9271c..f3735a3 100644
--- a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
+++ b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
@@ -187,14 +187,12 @@ public class HBaseStorageHandler extends DefaultStorageHandler
             tableProperties.getProperty(HBaseSerDe.HBASE_COLUMNS_PREFIX_HIDE, "false"));
     jobProperties.put(HBaseSerDe.HBASE_TABLE_DEFAULT_STORAGE_TYPE,
       tableProperties.getProperty(HBaseSerDe.HBASE_TABLE_DEFAULT_STORAGE_TYPE,"string"));
+    jobProperties.put(HBaseSerDe.HBASE_SCAN_CACHEBLOCKS, tableProperties
+        .getProperty(HBaseSerDe.HBASE_SCAN_CACHEBLOCKS, "false"));
     String scanCache = tableProperties.getProperty(HBaseSerDe.HBASE_SCAN_CACHE);
     if (scanCache != null) {
       jobProperties.put(HBaseSerDe.HBASE_SCAN_CACHE, scanCache);
     }
-    String scanCacheBlocks = tableProperties.getProperty(HBaseSerDe.HBASE_SCAN_CACHEBLOCKS);
-    if (scanCacheBlocks != null) {
-      jobProperties.put(HBaseSerDe.HBASE_SCAN_CACHEBLOCKS, scanCacheBlocks);
-    }
     String scanBatch = tableProperties.getProperty(HBaseSerDe.HBASE_SCAN_BATCH);
     if (scanBatch != null) {
       jobProperties.put(HBaseSerDe.HBASE_SCAN_BATCH, scanBatch);
diff --git a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseInputFormatUtil.java b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseInputFormatUtil.java
index bfcb1fa..a914b57 100644
--- a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseInputFormatUtil.java
+++ b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseInputFormatUtil.java
@@ -140,10 +140,11 @@ class HiveHBaseInputFormatUtil {
     if (scanCache != null) {
       scan.setCaching(Integer.parseInt(scanCache));
     }
-    String scanCacheBlocks = jobConf.get(HBaseSerDe.HBASE_SCAN_CACHEBLOCKS);
-    if (scanCacheBlocks != null) {
-      scan.setCacheBlocks(Boolean.parseBoolean(scanCacheBlocks));
-    }
+
+    boolean scanCacheBlocks =
+        jobConf.getBoolean(HBaseSerDe.HBASE_SCAN_CACHEBLOCKS, false);
+    scan.setCacheBlocks(scanCacheBlocks);
+
     String scanBatch = jobConf.get(HBaseSerDe.HBASE_SCAN_BATCH);
     if (scanBatch != null) {
       scan.setBatch(Integer.parseInt(scanBatch));