Review Board 1.7.22


HIVE-4535 - hive build fails with hadoop 0.20

Review Request #11036 - Created May 10, 2013 and updated

Thejas Nair
HIVE-4535
Reviewers
hive
hive-git
ant package -Dhadoop.mr.rev=20
leads to -
    [javac] /Users/thejas/hive_thejas_git/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java:382: cannot find symbol
    [javac] symbol  : method join(java.lang.String,java.util.List<java.lang.String>)
    [javac] location: class org.apache.hadoop.util.StringUtils
    [javac]           StringUtils.join(",", incompatibleCols)

import has hadoop StringUtils , but it does not have this function in hadoop 0.20 libraries.

 

Diff revision 2 (Latest)

1 2
1 2

  1. metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java: Loading...
metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java
Revision f9da781 New Change
[20] 34 lines
[+20]
35
import java.util.Properties;
35
import java.util.Properties;
36
import java.util.Set;
36
import java.util.Set;
37
import java.util.regex.Matcher;
37
import java.util.regex.Matcher;
38
import java.util.regex.Pattern;
38
import java.util.regex.Pattern;
39

    
   
39

   

    
   
40
import org.apache.commons.lang.StringUtils;
40
import org.apache.commons.logging.Log;
41
import org.apache.commons.logging.Log;
41
import org.apache.commons.logging.LogFactory;
42
import org.apache.commons.logging.LogFactory;
42
import org.apache.hadoop.conf.Configuration;
43
import org.apache.hadoop.conf.Configuration;
43
import org.apache.hadoop.fs.FileSystem;
44
import org.apache.hadoop.fs.FileSystem;
44
import org.apache.hadoop.fs.Path;
45
import org.apache.hadoop.fs.Path;
45
import org.apache.hadoop.hive.common.JavaUtils;
46
import org.apache.hadoop.hive.common.JavaUtils;
46
import org.apache.hadoop.hive.conf.HiveConf;
47
import org.apache.hadoop.hive.conf.HiveConf;
47
import org.apache.hadoop.hive.metastore.api.FieldSchema;
48
import org.apache.hadoop.hive.metastore.api.FieldSchema;

    
   
49
import org.apache.hadoop.hive.metastore.api.InvalidOperationException;
48
import org.apache.hadoop.hive.metastore.api.MetaException;
50
import org.apache.hadoop.hive.metastore.api.MetaException;
49
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
51
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
50
import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
52
import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
51
import org.apache.hadoop.hive.metastore.api.Table;
53
import org.apache.hadoop.hive.metastore.api.Table;
52
import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
54
import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
53
import org.apache.hadoop.hive.metastore.api.InvalidOperationException;
55
import org.apache.hadoop.hive.serde.serdeConstants;
54
import org.apache.hadoop.hive.serde.serdeConstants;;

   
55
import org.apache.hadoop.hive.serde2.Deserializer;
56
import org.apache.hadoop.hive.serde2.Deserializer;
56
import org.apache.hadoop.hive.serde2.SerDeException;
57
import org.apache.hadoop.hive.serde2.SerDeException;
57
import org.apache.hadoop.hive.serde2.SerDeUtils;
58
import org.apache.hadoop.hive.serde2.SerDeUtils;
58
import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe;
59
import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe;
59
import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
60
import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
60
import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
61
import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
61
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
62
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
62
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
63
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
63
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
64
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
64
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
65
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
65
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
66
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
66
import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge;
67
import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge;
67
import org.apache.hadoop.util.StringUtils;

   
68

    
   
68

   

    
   
69

   
69
public class MetaStoreUtils {
70
public class MetaStoreUtils {
70

    
   
71

   
71
  protected static final Log LOG = LogFactory.getLog("hive.log");
72
  protected static final Log LOG = LogFactory.getLog("hive.log");
72

    
   
73

   
73
  public static final String DEFAULT_DATABASE_NAME = "default";
74
  public static final String DEFAULT_DATABASE_NAME = "default";
[+20] [20] 303 lines
[+20] [+] static void throwExceptionIfIncompatibleColTypeChange(
377
    }
378
    }
378
    if (!incompatibleCols.isEmpty()) {
379
    if (!incompatibleCols.isEmpty()) {
379
      throw new InvalidOperationException(
380
      throw new InvalidOperationException(
380
          "The following columns have types incompatible with the existing " +
381
          "The following columns have types incompatible with the existing " +
381
          "columns in their respective positions :\n" +
382
          "columns in their respective positions :\n" +
382
          StringUtils.join(",", incompatibleCols)
383
          StringUtils.join(incompatibleCols, ',')
383
        );
384
        );
384
    }
385
    }
385
  }
386
  }
386

    
   
387

   
387
  /**
388
  /**
[+20] [20] 564 lines
[+20] [+] public static int findFreePort() throws IOException {
952
   *
953
   *
953
   * @param e
954
   * @param e
954
   * @throws MetaException
955
   * @throws MetaException
955
   */
956
   */
956
  static void logAndThrowMetaException(Exception e) throws MetaException {
957
  static void logAndThrowMetaException(Exception e) throws MetaException {
957
    LOG
958
    String exInfo = "Got exception: " + e.getClass().getName() + " "
958
        .error("Got exception: " + e.getClass().getName() + " "
959
        + e.getMessage();
959
            + e.getMessage());
960
    LOG.error(exInfo, e);
960
    LOG.error(StringUtils.stringifyException(e));
961
    LOG.error("Converting exception to MetaException");
961
    throw new MetaException("Got exception: " + e.getClass().getName() + " "
962
    throw new MetaException(exInfo);
962
        + e.getMessage());

   
963
  }
963
  }
964

    
   
964

   
965
  /**
965
  /**
966
   * @param tableName
966
   * @param tableName
967
   * @param deserializer
967
   * @param deserializer
[+20] [20] 315 lines
  1. metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java: Loading...