hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject svn commit: r1573191 - /hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
Date Sat, 01 Mar 2014 16:27:47 GMT
Author: xuefu
Date: Sat Mar  1 16:27:46 2014
New Revision: 1573191

URL: http://svn.apache.org/r1573191
Log:
HIVE-6356: Dependency injection in hbase storage handler is broken (reviewed by Navis)

Modified:
    hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java

Modified: hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
URL: http://svn.apache.org/viewvc/hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java?rev=1573191&r1=1573190&r2=1573191&view=diff
==============================================================================
--- hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
(original)
+++ hive/trunk/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
Sat Mar  1 16:27:46 2014
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -35,7 +36,8 @@ import org.apache.hadoop.hbase.HTableDes
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.mapred.TableOutputFormat;
-import org.apache.hadoop.hbase.mapred.TableMapReduceUtil;
+import org.apache.hadoop.hbase.mapreduce.TableInputFormatBase;
+import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hive.hbase.HBaseSerDe.ColumnMapping;
@@ -376,9 +378,20 @@ public class HBaseStorageHandler extends
   @Override
   public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {
     try {
-      TableMapReduceUtil.addDependencyJars(jobConf);
-      org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addDependencyJars(jobConf,
-          HBaseStorageHandler.class, org.apache.hadoop.hbase.HBaseConfiguration.class);
+      /*
+       * HIVE-6356
+       * The following code change is only needed for hbase-0.96.0 due to HBASE-9165, and
+       * will not be required once Hive bumps up its hbase version). At that time , we will
+       * only need TableMapReduceUtil.addDependencyJars(jobConf) here.
+       */
+      TableMapReduceUtil.addDependencyJars(
+          jobConf, HBaseStorageHandler.class, TableInputFormatBase.class);
+      Set<String> merged = new LinkedHashSet<String>(jobConf.getStringCollection("tmpjars"));
+
+      Job copy = new Job(jobConf);
+      TableMapReduceUtil.addDependencyJars(copy);
+      merged.addAll(copy.getConfiguration().getStringCollection("tmpjars"));
+      jobConf.set("tmpjars", StringUtils.arrayToString(merged.toArray(new String[0])));
     } catch (IOException e) {
       throw new RuntimeException(e);
     }



Mime
View raw message