Search in sources :

Example 1 with GetPartitionResponse

use of org.apache.hadoop.hive.metastore.api.GetPartitionResponse in project hive by apache.

the class Hive method getPartition.

public org.apache.hadoop.hive.metastore.api.Partition getPartition(Table t, String dbName, String tableName, List<String> params) throws HiveException {
    try {
        GetPartitionRequest req = new GetPartitionRequest();
        req.setDbName(dbName);
        req.setTblName(tableName);
        req.setPartVals(params);
        if (AcidUtils.isTransactionalTable(t)) {
            ValidWriteIdList validWriteIdList = getValidWriteIdList(dbName, tableName);
            req.setValidWriteIdList(validWriteIdList != null ? validWriteIdList.toString() : null);
            req.setId(t.getTTable().getId());
        }
        GetPartitionResponse res = getMSC().getPartitionRequest(req);
        return res.getPartition();
    } catch (Exception e) {
        LOG.error("Failed getPartition", e);
        throw new HiveException(e);
    }
}
Also used : ValidWriteIdList(org.apache.hadoop.hive.common.ValidWriteIdList) GetPartitionResponse(org.apache.hadoop.hive.metastore.api.GetPartitionResponse) GetPartitionRequest(org.apache.hadoop.hive.metastore.api.GetPartitionRequest) AlreadyExistsException(org.apache.hadoop.hive.metastore.api.AlreadyExistsException) LockException(org.apache.hadoop.hive.ql.lockmgr.LockException) InvalidOperationException(org.apache.hadoop.hive.metastore.api.InvalidOperationException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) ExecutionException(java.util.concurrent.ExecutionException) NoSuchObjectException(org.apache.hadoop.hive.metastore.api.NoSuchObjectException) MetaException(org.apache.hadoop.hive.metastore.api.MetaException) HiveMetaException(org.apache.hadoop.hive.metastore.HiveMetaException) SemanticException(org.apache.hadoop.hive.ql.parse.SemanticException) TApplicationException(org.apache.thrift.TApplicationException) TException(org.apache.thrift.TException) SerDeException(org.apache.hadoop.hive.serde2.SerDeException) FileNotFoundException(java.io.FileNotFoundException) JDODataStoreException(javax.jdo.JDODataStoreException)

Example 2 with GetPartitionResponse

use of org.apache.hadoop.hive.metastore.api.GetPartitionResponse in project hive by apache.

the class TestHiveMetaStoreClient method getPartitionRequest.

public GetPartitionResponse getPartitionRequest(GetPartitionRequest req) throws NoSuchObjectException, MetaException, TException {
    assertNotNull(req.getId());
    assertNotNull(req.getValidWriteIdList());
    GetPartitionResponse res = new GetPartitionResponse();
    return res;
}
Also used : GetPartitionResponse(org.apache.hadoop.hive.metastore.api.GetPartitionResponse)

Aggregations

GetPartitionResponse (org.apache.hadoop.hive.metastore.api.GetPartitionResponse)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 ExecutionException (java.util.concurrent.ExecutionException)1 JDODataStoreException (javax.jdo.JDODataStoreException)1 ValidWriteIdList (org.apache.hadoop.hive.common.ValidWriteIdList)1 HiveMetaException (org.apache.hadoop.hive.metastore.HiveMetaException)1 AlreadyExistsException (org.apache.hadoop.hive.metastore.api.AlreadyExistsException)1 GetPartitionRequest (org.apache.hadoop.hive.metastore.api.GetPartitionRequest)1 InvalidOperationException (org.apache.hadoop.hive.metastore.api.InvalidOperationException)1 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)1 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)1 LockException (org.apache.hadoop.hive.ql.lockmgr.LockException)1 SemanticException (org.apache.hadoop.hive.ql.parse.SemanticException)1 SerDeException (org.apache.hadoop.hive.serde2.SerDeException)1 TApplicationException (org.apache.thrift.TApplicationException)1 TException (org.apache.thrift.TException)1