Review Board 1.7.22


HIVE-4723 DDLSemanticAnalyzer.addTablePartsOutputs eats several exceptions

Review Request #14970 - Created Oct. 26, 2013 and updated

Szehon Ho
HIVE-4723
Reviewers
hive
hive-git
Throwing the offending exception, that was swallowed.  Also changing the underlying exception to use the standard error message.

 
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
Revision b0f124b New Change
[20] 75 lines
[+20]
76
import org.apache.hadoop.hive.metastore.api.PrivilegeBag;
76
import org.apache.hadoop.hive.metastore.api.PrivilegeBag;
77
import org.apache.hadoop.hive.metastore.api.Role;
77
import org.apache.hadoop.hive.metastore.api.Role;
78
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
78
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
79
import org.apache.hadoop.hive.metastore.api.SkewedInfo;
79
import org.apache.hadoop.hive.metastore.api.SkewedInfo;
80
import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
80
import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;

    
   
81
import org.apache.hadoop.hive.ql.ErrorMsg;
81
import org.apache.hadoop.hive.ql.exec.Utilities;
82
import org.apache.hadoop.hive.ql.exec.Utilities;
82
import org.apache.hadoop.hive.ql.index.HiveIndexHandler;
83
import org.apache.hadoop.hive.ql.index.HiveIndexHandler;
83
import org.apache.hadoop.hive.ql.optimizer.listbucketingpruner.ListBucketingPrunerUtils;
84
import org.apache.hadoop.hive.ql.optimizer.listbucketingpruner.ListBucketingPrunerUtils;
84
import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
85
import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
85
import org.apache.hadoop.hive.ql.session.CreateTableAutomaticGrant;
86
import org.apache.hadoop.hive.ql.session.CreateTableAutomaticGrant;
[+20] [20] 1676 lines
[+20] [+] public boolean dropPartition(String db_name, String tbl_name,
1762
   */
1763
   */
1763
  public List<Partition> getPartitions(Table tbl, Map<String, String> partialPartSpec,
1764
  public List<Partition> getPartitions(Table tbl, Map<String, String> partialPartSpec,
1764
      short limit)
1765
      short limit)
1765
  throws HiveException {
1766
  throws HiveException {
1766
    if (!tbl.isPartitioned()) {
1767
    if (!tbl.isPartitioned()) {
1767
      throw new HiveException("Partition spec should only be supplied for a " +
1768
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
1768
          "partitioned table");

   
1769
    }
1769
    }
1770

    
   
1770

   
1771
    List<String> partialPvals = MetaStoreUtils.getPvals(tbl.getPartCols(), partialPartSpec);
1771
    List<String> partialPvals = MetaStoreUtils.getPvals(tbl.getPartCols(), partialPartSpec);
1772

    
   
1772

   
1773
    List<org.apache.hadoop.hive.metastore.api.Partition> partitions = null;
1773
    List<org.apache.hadoop.hive.metastore.api.Partition> partitions = null;
[+20] [20] 42 lines
[+20] public boolean dropPartition(String db_name, String tbl_name,
1816
  public List<Partition> getPartitionsByNames(Table tbl,
1816
  public List<Partition> getPartitionsByNames(Table tbl,
1817
      Map<String, String> partialPartSpec)
1817
      Map<String, String> partialPartSpec)
1818
      throws HiveException {
1818
      throws HiveException {
1819

    
   
1819

   
1820
    if (!tbl.isPartitioned()) {
1820
    if (!tbl.isPartitioned()) {
1821
      throw new HiveException("Partition spec should only be supplied for a " +
1821
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
1822
                "partitioned table");

   
1823
    }
1822
    }
1824

    
   
1823

   
1825
    List<String> names = getPartitionNames(tbl.getDbName(), tbl.getTableName(),
1824
    List<String> names = getPartitionNames(tbl.getDbName(), tbl.getTableName(),
1826
        partialPartSpec, (short)-1);
1825
        partialPartSpec, (short)-1);
1827

    
   
1826

   
[+20] [20] 13 lines
[+20] public boolean dropPartition(String db_name, String tbl_name,
1841
   */
1840
   */
1842
  public List<Partition> getPartitionsByNames(Table tbl, List<String> partNames)
1841
  public List<Partition> getPartitionsByNames(Table tbl, List<String> partNames)
1843
      throws HiveException {
1842
      throws HiveException {
1844

    
   
1843

   
1845
    if (!tbl.isPartitioned()) {
1844
    if (!tbl.isPartitioned()) {
1846
      throw new HiveException("Partition spec should only be supplied for a " +
1845
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
1847
          "partitioned table");

   
1848
    }
1846
    }
1849
    List<Partition> partitions = new ArrayList<Partition>(partNames.size());
1847
    List<Partition> partitions = new ArrayList<Partition>(partNames.size());
1850

    
   
1848

   
1851
    int batchSize = HiveConf.getIntVar(conf, HiveConf.ConfVars.METASTORE_BATCH_RETRIEVE_MAX);
1849
    int batchSize = HiveConf.getIntVar(conf, HiveConf.ConfVars.METASTORE_BATCH_RETRIEVE_MAX);
1852
    // TODO: might want to increase the default batch size. 1024 is viable; MS gets OOM if too high.
1850
    // TODO: might want to increase the default batch size. 1024 is viable; MS gets OOM if too high.
[+20] [20] 40 lines
[+20] public boolean dropPartition(String db_name, String tbl_name,
1893
   */
1891
   */
1894
  public List<Partition> getPartitionsByFilter(Table tbl, String filter)
1892
  public List<Partition> getPartitionsByFilter(Table tbl, String filter)
1895
      throws HiveException, MetaException, NoSuchObjectException, TException {
1893
      throws HiveException, MetaException, NoSuchObjectException, TException {
1896

    
   
1894

   
1897
    if (!tbl.isPartitioned()) {
1895
    if (!tbl.isPartitioned()) {
1898
      throw new HiveException("Partition spec should only be supplied for a " +
1896
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
1899
          "partitioned table");

   
1900
    }
1897
    }
1901

    
   
1898

   
1902
    List<org.apache.hadoop.hive.metastore.api.Partition> tParts = getMSC().listPartitionsByFilter(
1899
    List<org.apache.hadoop.hive.metastore.api.Partition> tParts = getMSC().listPartitionsByFilter(
1903
        tbl.getDbName(), tbl.getTableName(), filter, (short)-1);
1900
        tbl.getDbName(), tbl.getTableName(), filter, (short)-1);
1904
    return convertFromMetastore(tbl, tParts, null);
1901
    return convertFromMetastore(tbl, tParts, null);
[+20] [20] 664 lines
ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
Revision 037191a New Change
 
ql/src/test/results/clientnegative/alter_rename_partition_failure3.q.out
Revision 384fcbe New Change
 
ql/src/test/results/clientnegative/touch2.q.out
Revision 045121a New Change
 
  1. ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java: Loading...
  2. ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java: Loading...
  3. ql/src/test/results/clientnegative/alter_rename_partition_failure3.q.out: Loading...
  4. ql/src/test/results/clientnegative/touch2.q.out: Loading...