Search in sources :

Example 6 with PartitionValuesRequest

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

the class TestListPartitions method testListPartitionValuesNoDb.

@Test(expected = MetaException.class)
public void testListPartitionValuesNoDb() throws Exception {
    client.dropDatabase(DB_NAME);
    List<FieldSchema> partitionSchema = Lists.newArrayList(new FieldSchema("yyyy", "string", ""), new FieldSchema("mm", "string", ""));
    PartitionValuesRequest request = new PartitionValuesRequest(DB_NAME, TABLE_NAME, partitionSchema);
    client.listPartitionValues(request);
}
Also used : PartitionValuesRequest(org.apache.hadoop.hive.metastore.api.PartitionValuesRequest) FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 7 with PartitionValuesRequest

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

the class TestListPartitions method testListPartitionValuesNullDbName.

@Test
public void testListPartitionValuesNullDbName() throws Exception {
    try {
        createTable4PartColsParts(client);
        List<FieldSchema> partitionSchema = Lists.newArrayList(new FieldSchema("yyyy", "string", ""), new FieldSchema("mm", "string", ""));
        PartitionValuesRequest request = new PartitionValuesRequest(null, TABLE_NAME, partitionSchema);
        client.listPartitionValues(request);
        fail("Should have thrown exception");
    } catch (NullPointerException | TProtocolException e) {
    // TODO: should not throw different exceptions for different HMS deployment types
    }
}
Also used : PartitionValuesRequest(org.apache.hadoop.hive.metastore.api.PartitionValuesRequest) FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) TProtocolException(org.apache.thrift.protocol.TProtocolException) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 8 with PartitionValuesRequest

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

the class TestListPartitions method testListPartitionValuesNoTblName.

@Test(expected = MetaException.class)
public void testListPartitionValuesNoTblName() throws Exception {
    createTable4PartColsParts(client);
    List<FieldSchema> partitionSchema = Lists.newArrayList(new FieldSchema("yyyy", "string", ""), new FieldSchema("mm", "string", ""));
    PartitionValuesRequest request = new PartitionValuesRequest(DB_NAME, "", partitionSchema);
    client.listPartitionValues(request);
}
Also used : PartitionValuesRequest(org.apache.hadoop.hive.metastore.api.PartitionValuesRequest) FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 9 with PartitionValuesRequest

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

the class TestListPartitions method testListPartitionValuesNoDbName.

@Test(expected = MetaException.class)
public void testListPartitionValuesNoDbName() throws Exception {
    createTable4PartColsParts(client);
    List<FieldSchema> partitionSchema = Lists.newArrayList(new FieldSchema("yyyy", "string", ""), new FieldSchema("mm", "string", ""));
    PartitionValuesRequest request = new PartitionValuesRequest("", TABLE_NAME, partitionSchema);
    client.listPartitionValues(request);
}
Also used : PartitionValuesRequest(org.apache.hadoop.hive.metastore.api.PartitionValuesRequest) FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Aggregations

MetastoreCheckinTest (org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)9 PartitionValuesRequest (org.apache.hadoop.hive.metastore.api.PartitionValuesRequest)9 Test (org.junit.Test)9 FieldSchema (org.apache.hadoop.hive.metastore.api.FieldSchema)8 TProtocolException (org.apache.thrift.protocol.TProtocolException)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 PartitionValuesResponse (org.apache.hadoop.hive.metastore.api.PartitionValuesResponse)1 TTransportException (org.apache.thrift.transport.TTransportException)1