hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject svn commit: r1670534 [8/8] - in /hive/branches/llap: ./ beeline/src/java/org/apache/hive/beeline/ conf/ data/files/ hcatalog/hcatalog-pig-adapter/ hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/ hcatalog/src/test/e2e/templeton...
Date Wed, 01 Apr 2015 01:15:52 GMT
Modified: hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf.q.out
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf.q.out?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf.q.out (original)
+++ hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf.q.out Wed Apr
 1 01:15:50 2015
@@ -790,7 +790,7 @@ STAGE PLANS:
             alias: decimal_udf
             Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
             Filter Operator
-              predicate: ((key * CAST( value AS decimal(10,0))) > CAST( 0 AS decimal(31,10)))
(type: boolean)
+              predicate: ((key * CAST( value AS decimal(10,0))) > 0) (type: boolean)
               Statistics: Num rows: 12 Data size: 1356 Basic stats: COMPLETE Column stats:
NONE
               Select Operator
                 expressions: key (type: decimal(20,10)), value (type: int)
@@ -1100,7 +1100,7 @@ STAGE PLANS:
             alias: decimal_udf
             Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
             Select Operator
-              expressions: (key / CAST( 0 AS decimal(10,0))) (type: decimal(22,12))
+              expressions: (key / 0) (type: decimal(22,12))
               outputColumnNames: _col0
               Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
               Limit
@@ -1192,7 +1192,7 @@ STAGE PLANS:
             alias: decimal_udf
             Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
             Filter Operator
-              predicate: (key <> CAST( 0 AS decimal(20,10))) (type: boolean)
+              predicate: (key <> 0) (type: boolean)
               Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
               Select Operator
                 expressions: (key / key) (type: decimal(38,24))
@@ -2157,7 +2157,7 @@ STAGE PLANS:
             alias: decimal_udf
             Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
             Select Operator
-              expressions: ((key + CAST( 1 AS decimal(10,0))) % (key / CAST( 2 AS decimal(10,0))))
(type: decimal(22,12))
+              expressions: ((key + 1) % (key / 2)) (type: decimal(22,12))
               outputColumnNames: _col0
               Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
               File Output Operator

Modified: hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf2.q.out
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf2.q.out?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf2.q.out (original)
+++ hive/branches/llap/ql/src/test/results/clientpositive/vector_decimal_udf2.q.out Wed Apr
 1 01:15:50 2015
@@ -68,10 +68,10 @@ STAGE PLANS:
             alias: decimal_udf2
             Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
             Filter Operator
-              predicate: (key = CAST( 10 AS decimal(20,10))) (type: boolean)
+              predicate: (key = 10) (type: boolean)
               Statistics: Num rows: 19 Data size: 2148 Basic stats: COMPLETE Column stats:
NONE
               Select Operator
-                expressions: acos(key) (type: double), asin(key) (type: double), atan(key)
(type: double), cos(key) (type: double), sin(key) (type: double), tan(key) (type: double),
radians(key) (type: double)
+                expressions: NaN (type: double), NaN (type: double), 1.4711276743037347 (type:
double), -0.8390715290764524 (type: double), -0.5440211108893698 (type: double), 0.6483608274590866
(type: double), 0.17453292519943295 (type: double)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
                 Statistics: Num rows: 19 Data size: 2148 Basic stats: COMPLETE Column stats:
NONE
                 File Output Operator
@@ -126,10 +126,10 @@ STAGE PLANS:
             alias: decimal_udf2
             Statistics: Num rows: 38 Data size: 4296 Basic stats: COMPLETE Column stats:
NONE
             Filter Operator
-              predicate: (key = CAST( 10 AS decimal(20,10))) (type: boolean)
+              predicate: (key = 10) (type: boolean)
               Statistics: Num rows: 19 Data size: 2148 Basic stats: COMPLETE Column stats:
NONE
               Select Operator
-                expressions: exp(key) (type: double), ln(key) (type: double), log(key) (type:
double), log(key, key) (type: double), log(key, value) (type: double), log(value, key) (type:
double), log10(key) (type: double), sqrt(key) (type: double)
+                expressions: 22026.465794806718 (type: double), 2.302585092994046 (type:
double), 2.302585092994046 (type: double), 1.0 (type: double), log(10, value) (type: double),
log(value, 10) (type: double), 1.0 (type: double), 3.1622776601683795 (type: double)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
                 Statistics: Num rows: 19 Data size: 2148 Basic stats: COMPLETE Column stats:
NONE
                 File Output Operator

Modified: hive/branches/llap/ql/src/test/results/clientpositive/vector_mapjoin_reduce.q.out
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/results/clientpositive/vector_mapjoin_reduce.q.out?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/ql/src/test/results/clientpositive/vector_mapjoin_reduce.q.out (original)
+++ hive/branches/llap/ql/src/test/results/clientpositive/vector_mapjoin_reduce.q.out Wed
Apr  1 01:15:50 2015
@@ -77,11 +77,11 @@ STAGE PLANS:
   Stage: Stage-9
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$INTNAME1 
+        $INTNAME1 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$INTNAME1 
+        $INTNAME1 
           TableScan
             HashTable Sink Operator
               keys:
@@ -114,11 +114,11 @@ STAGE PLANS:
   Stage: Stage-10
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$INTNAME 
+        $INTNAME 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$INTNAME 
+        $INTNAME 
           TableScan
             HashTable Sink Operator
               keys:
@@ -188,11 +188,11 @@ STAGE PLANS:
   Stage: Stage-11
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$hdt$_1:$hdt$_1:lineitem 
+        $hdt$_1:lineitem 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$hdt$_1:$hdt$_1:lineitem 
+        $hdt$_1:lineitem 
           TableScan
             alias: lineitem
             Statistics: Num rows: 100 Data size: 11999 Basic stats: COMPLETE Column stats:
NONE
@@ -342,11 +342,11 @@ STAGE PLANS:
   Stage: Stage-9
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$INTNAME1 
+        $INTNAME1 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$INTNAME1 
+        $INTNAME1 
           TableScan
             HashTable Sink Operator
               keys:
@@ -379,11 +379,11 @@ STAGE PLANS:
   Stage: Stage-10
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$INTNAME 
+        $INTNAME 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$INTNAME 
+        $INTNAME 
           TableScan
             HashTable Sink Operator
               keys:
@@ -453,11 +453,11 @@ STAGE PLANS:
   Stage: Stage-11
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$hdt$_1:$hdt$_1:lineitem 
+        $hdt$_1:lineitem 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$hdt$_1:$hdt$_1:lineitem 
+        $hdt$_1:lineitem 
           TableScan
             alias: lineitem
             Statistics: Num rows: 100 Data size: 11999 Basic stats: COMPLETE Column stats:
NONE

Modified: hive/branches/llap/ql/src/test/results/clientpositive/windowing_streaming.q.out
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/results/clientpositive/windowing_streaming.q.out?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/ql/src/test/results/clientpositive/windowing_streaming.q.out (original)
+++ hive/branches/llap/ql/src/test/results/clientpositive/windowing_streaming.q.out Wed Apr
 1 01:15:50 2015
@@ -65,43 +65,39 @@ STAGE PLANS:
           TableScan
             alias: part
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
-            Select Operator
-              expressions: p_name (type: string), p_mfgr (type: string)
-              outputColumnNames: _col0, _col1
+            Reduce Output Operator
+              key expressions: p_mfgr (type: string), p_name (type: string)
+              sort order: ++
+              Map-reduce partition columns: p_mfgr (type: string)
               Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
-              Reduce Output Operator
-                key expressions: _col1 (type: string), _col0 (type: string)
-                sort order: ++
-                Map-reduce partition columns: _col1 (type: string)
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
       Reduce Operator Tree:
         Select Operator
           expressions: KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string)
-          outputColumnNames: _col0, _col1
+          outputColumnNames: _col1, _col2
           Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
           PTF Operator
             Function definitions:
                 Input definition
                   input alias: ptf_0
-                  output shape: _col0: string, _col1: string
+                  output shape: _col1: string, _col2: string
                   type: WINDOWING
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
-                  partition by: _col1
+                  order by: _col1
+                  partition by: _col2
                   raw input shape:
                   window functions:
                       window function definition
                         alias: _wcol0
-                        arguments: _col0
+                        arguments: _col1
                         name: rank
                         window function: GenericUDAFRankEvaluator
                         window frame: PRECEDING(MAX)~FOLLOWING(MAX)
                         isPivotResult: true
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
             Select Operator
-              expressions: _col1 (type: string), _wcol0 (type: int)
+              expressions: _col2 (type: string), _wcol0 (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
               File Output Operator
@@ -139,37 +135,33 @@ STAGE PLANS:
           TableScan
             alias: part
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
-            Select Operator
-              expressions: p_name (type: string), p_mfgr (type: string)
-              outputColumnNames: _col0, _col1
+            Reduce Output Operator
+              key expressions: p_mfgr (type: string), p_name (type: string)
+              sort order: ++
+              Map-reduce partition columns: p_mfgr (type: string)
               Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
-              Reduce Output Operator
-                key expressions: _col1 (type: string), _col0 (type: string)
-                sort order: ++
-                Map-reduce partition columns: _col1 (type: string)
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats:
NONE
-                TopN Hash Memory Usage: 0.8
+              TopN Hash Memory Usage: 0.8
       Reduce Operator Tree:
         Select Operator
           expressions: KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string)
-          outputColumnNames: _col0, _col1
+          outputColumnNames: _col1, _col2
           Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
           PTF Operator
             Function definitions:
                 Input definition
                   input alias: ptf_0
-                  output shape: _col0: string, _col1: string
+                  output shape: _col1: string, _col2: string
                   type: WINDOWING
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
-                  partition by: _col1
+                  order by: _col1
+                  partition by: _col2
                   raw input shape:
                   window functions:
                       window function definition
                         alias: _wcol0
-                        arguments: _col0
+                        arguments: _col1
                         name: rank
                         window function: GenericUDAFRankEvaluator
                         window frame: PRECEDING(MAX)~FOLLOWING(MAX)
@@ -179,7 +171,7 @@ STAGE PLANS:
               predicate: (_wcol0 < 4) (type: boolean)
               Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE Column stats:
NONE
               Select Operator
-                expressions: _col1 (type: string), _wcol0 (type: int)
+                expressions: _col2 (type: string), _wcol0 (type: int)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE Column stats:
NONE
                 File Output Operator
@@ -312,37 +304,33 @@ STAGE PLANS:
           TableScan
             alias: alltypesorc
             Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats:
NONE
-            Select Operator
-              expressions: ctinyint (type: tinyint), cdouble (type: double)
-              outputColumnNames: _col0, _col1
+            Reduce Output Operator
+              key expressions: ctinyint (type: tinyint), cdouble (type: double)
+              sort order: ++
+              Map-reduce partition columns: ctinyint (type: tinyint)
               Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column
stats: NONE
-              Reduce Output Operator
-                key expressions: _col0 (type: tinyint), _col1 (type: double)
-                sort order: ++
-                Map-reduce partition columns: _col0 (type: tinyint)
-                Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column
stats: NONE
-                TopN Hash Memory Usage: 0.8
+              TopN Hash Memory Usage: 0.8
       Reduce Operator Tree:
         Select Operator
           expressions: KEY.reducesinkkey0 (type: tinyint), KEY.reducesinkkey1 (type: double)
-          outputColumnNames: _col0, _col1
+          outputColumnNames: _col0, _col5
           Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats:
NONE
           PTF Operator
             Function definitions:
                 Input definition
                   input alias: ptf_0
-                  output shape: _col0: tinyint, _col1: double
+                  output shape: _col0: tinyint, _col5: double
                   type: WINDOWING
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col5
                   partition by: _col0
                   raw input shape:
                   window functions:
                       window function definition
                         alias: _wcol0
-                        arguments: _col1
+                        arguments: _col5
                         name: rank
                         window function: GenericUDAFRankEvaluator
                         window frame: PRECEDING(MAX)~FOLLOWING(MAX)
@@ -352,7 +340,7 @@ STAGE PLANS:
               predicate: (_wcol0 < 5) (type: boolean)
               Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats:
NONE
               Select Operator
-                expressions: _col0 (type: tinyint), _col1 (type: double), _wcol0 (type: int)
+                expressions: _col0 (type: tinyint), _col5 (type: double), _wcol0 (type: int)
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column
stats: NONE
                 File Output Operator

Modified: hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroObjectInspectorGenerator.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroObjectInspectorGenerator.java?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroObjectInspectorGenerator.java
(original)
+++ hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroObjectInspectorGenerator.java
Wed Apr  1 01:15:50 2015
@@ -43,13 +43,15 @@ import org.apache.hadoop.hive.serde2.typ
 public class AvroObjectInspectorGenerator {
   final private List<String> columnNames;
   final private List<TypeInfo> columnTypes;
+  final private List<String> columnComments;
   final private ObjectInspector oi;
 
   public AvroObjectInspectorGenerator(Schema schema) throws SerDeException {
     verifySchemaIsARecord(schema);
 
-    this.columnNames = generateColumnNames(schema);
+    this.columnNames = AvroObjectInspectorGenerator.generateColumnNames(schema);
     this.columnTypes = SchemaToTypeInfo.generateColumnTypes(schema);
+    this.columnComments = AvroObjectInspectorGenerator.generateColumnComments(schema);
     assert columnNames.size() == columnTypes.size();
     this.oi = createObjectInspector();
   }
@@ -80,7 +82,7 @@ public class AvroObjectInspectorGenerato
     for(int i = 0; i < columnNames.size(); i++) {
       columnOIs.add(i, createObjectInspectorWorker(columnTypes.get(i)));
     }
-    return ObjectInspectorFactory.getStandardStructObjectInspector(columnNames, columnOIs);
+    return ObjectInspectorFactory.getStandardStructObjectInspector(columnNames, columnOIs,
columnComments);
   }
 
   private ObjectInspector createObjectInspectorWorker(TypeInfo ti) throws SerDeException
{
@@ -145,7 +147,7 @@ public class AvroObjectInspectorGenerato
            c.equals(ObjectInspector.Category.UNION);
   }
 
-  private List<String> generateColumnNames(Schema schema) {
+  public static List<String> generateColumnNames(Schema schema) {
     List<Schema.Field> fields = schema.getFields();
     List<String> fieldsList = new ArrayList<String>(fields.size());
 
@@ -156,4 +158,15 @@ public class AvroObjectInspectorGenerato
     return fieldsList;
   }
 
+  public static List<String> generateColumnComments(Schema schema) {
+    List<Schema.Field> fields = schema.getFields();
+    List<String> fieldComments = new ArrayList<String>(fields.size());
+
+    for (Schema.Field field : fields) {
+      String fieldComment = field.doc() == null ? "" : field.doc();
+      fieldComments.add(fieldComment);
+    }
+
+    return fieldComments;
+  }
 }

Modified: hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java (original)
+++ hive/branches/llap/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java Wed
Apr  1 01:15:50 2015
@@ -133,7 +133,9 @@ public class AvroSerDe extends AbstractS
     if (columnCommentProperty == null || columnCommentProperty.isEmpty()) {
       columnComments = new ArrayList<String>();
     } else {
-      columnComments = Arrays.asList(columnCommentProperty.split(","));
+      //Comments are separated by "\0" in columnCommentProperty, see method getSchema
+      //in MetaStoreUtils where this string columns.comments is generated
+      columnComments = Arrays.asList(columnCommentProperty.split("\0"));
       LOG.info("columnComments is " + columnCommentProperty);
     }
     if (columnNames.size() != columnTypes.size()) {

Modified: hive/branches/llap/service/src/java/org/apache/hive/service/auth/HiveAuthFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/service/src/java/org/apache/hive/service/auth/HiveAuthFactory.java?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/service/src/java/org/apache/hive/service/auth/HiveAuthFactory.java
(original)
+++ hive/branches/llap/service/src/java/org/apache/hive/service/auth/HiveAuthFactory.java
Wed Apr  1 01:15:50 2015
@@ -37,6 +37,7 @@ import org.apache.hadoop.hive.metastore.
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.shims.HadoopShims.KerberosNameShim;
 import org.apache.hadoop.hive.shims.ShimLoader;
+import org.apache.hadoop.hive.thrift.DBTokenStore;
 import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge;
 import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server.ServerMode;
 import org.apache.hadoop.security.SecurityUtil;
@@ -110,9 +111,17 @@ public class HiveAuthFactory {
                         conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL));
         // start delegation token manager
         try {
-          HMSHandler baseHandler = new HiveMetaStore.HMSHandler(
-              "new db based metaserver", conf, true);
-          saslServer.startDelegationTokenSecretManager(conf, baseHandler.getMS(), ServerMode.HIVESERVER2);
+          // rawStore is only necessary for DBTokenStore
+          Object rawStore = null;
+          String tokenStoreClass = conf.getVar(HiveConf.ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS);
+
+          if (tokenStoreClass.equals(DBTokenStore.class.getName())) {
+            HMSHandler baseHandler = new HiveMetaStore.HMSHandler(
+                "new db based metaserver", conf, true);
+            rawStore = baseHandler.getMS();
+          }
+
+          saslServer.startDelegationTokenSecretManager(conf, rawStore, ServerMode.HIVESERVER2);
         }
         catch (MetaException|IOException e) {
           throw new TTransportException("Failed to start token manager", e);

Modified: hive/branches/llap/shims/common/src/main/java/org/apache/hadoop/hive/shims/ShimLoader.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/shims/common/src/main/java/org/apache/hadoop/hive/shims/ShimLoader.java?rev=1670534&r1=1670533&r2=1670534&view=diff
==============================================================================
--- hive/branches/llap/shims/common/src/main/java/org/apache/hadoop/hive/shims/ShimLoader.java
(original)
+++ hive/branches/llap/shims/common/src/main/java/org/apache/hadoop/hive/shims/ShimLoader.java
Wed Apr  1 01:15:50 2015
@@ -29,6 +29,9 @@ import org.apache.log4j.AppenderSkeleton
  *
  */
 public abstract class ShimLoader {
+  public static String HADOOP20SVERSIONNAME = "0.20S";
+  public static String HADOOP23VERSIONNAME = "0.23";
+
   private static HadoopShims hadoopShims;
   private static JettyShims jettyShims;
   private static AppenderSkeleton eventCounter;
@@ -42,8 +45,8 @@ public abstract class ShimLoader {
       new HashMap<String, String>();
 
   static {
-    HADOOP_SHIM_CLASSES.put("0.20S", "org.apache.hadoop.hive.shims.Hadoop20SShims");
-    HADOOP_SHIM_CLASSES.put("0.23", "org.apache.hadoop.hive.shims.Hadoop23Shims");
+    HADOOP_SHIM_CLASSES.put(HADOOP20SVERSIONNAME, "org.apache.hadoop.hive.shims.Hadoop20SShims");
+    HADOOP_SHIM_CLASSES.put(HADOOP23VERSIONNAME, "org.apache.hadoop.hive.shims.Hadoop23Shims");
   }
 
   /**
@@ -54,8 +57,8 @@ public abstract class ShimLoader {
       new HashMap<String, String>();
 
   static {
-    JETTY_SHIM_CLASSES.put("0.20S", "org.apache.hadoop.hive.shims.Jetty20SShims");
-    JETTY_SHIM_CLASSES.put("0.23", "org.apache.hadoop.hive.shims.Jetty23Shims");
+    JETTY_SHIM_CLASSES.put(HADOOP20SVERSIONNAME, "org.apache.hadoop.hive.shims.Jetty20SShims");
+    JETTY_SHIM_CLASSES.put(HADOOP23VERSIONNAME, "org.apache.hadoop.hive.shims.Jetty23Shims");
   }
 
   /**
@@ -65,8 +68,10 @@ public abstract class ShimLoader {
       new HashMap<String, String>();
 
   static {
-    EVENT_COUNTER_SHIM_CLASSES.put("0.20S", "org.apache.hadoop.log.metrics.EventCounter");
-    EVENT_COUNTER_SHIM_CLASSES.put("0.23", "org.apache.hadoop.log.metrics.EventCounter");
+    EVENT_COUNTER_SHIM_CLASSES.put(HADOOP20SVERSIONNAME, "org.apache.hadoop.log.metrics"
+
+        ".EventCounter");
+    EVENT_COUNTER_SHIM_CLASSES.put(HADOOP23VERSIONNAME, "org.apache.hadoop.log.metrics" +
+        ".EventCounter");
   }
 
   /**
@@ -76,9 +81,9 @@ public abstract class ShimLoader {
       new HashMap<String, String>();
 
   static {
-    HADOOP_THRIFT_AUTH_BRIDGE_CLASSES.put("0.20S",
+    HADOOP_THRIFT_AUTH_BRIDGE_CLASSES.put(HADOOP20SVERSIONNAME,
         "org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge");
-    HADOOP_THRIFT_AUTH_BRIDGE_CLASSES.put("0.23",
+    HADOOP_THRIFT_AUTH_BRIDGE_CLASSES.put(HADOOP23VERSIONNAME,
         "org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge23");
   }
 
@@ -162,9 +167,9 @@ public abstract class ShimLoader {
 
     switch (Integer.parseInt(parts[0])) {
     case 1:
-      return "0.20S";
+      return HADOOP20SVERSIONNAME;
     case 2:
-      return "0.23";
+      return HADOOP23VERSIONNAME;
     default:
       throw new IllegalArgumentException("Unrecognized Hadoop major version number: " + vers);
     }



Mime
View raw message