use of org.apache.hadoop.hive.metastore.api.PartitionValuesRequest in project hive by apache.
the class TestListPartitions method testListPartitionValuesEmptySchema.
@Test
public void testListPartitionValuesEmptySchema() throws Exception {
try {
List<List<String>> testValues = createTable4PartColsParts(client);
List<FieldSchema> partitionSchema = Lists.newArrayList();
PartitionValuesRequest request = new PartitionValuesRequest(DB_NAME, TABLE_NAME, partitionSchema);
client.listPartitionValues(request);
fail("Should have thrown exception");
} catch (IndexOutOfBoundsException | TTransportException e) {
// TODO: should not throw different exceptions for different HMS deployment types
}
}
use of org.apache.hadoop.hive.metastore.api.PartitionValuesRequest in project hive by apache.
the class TestListPartitions method testListPartitionValuesNoTable.
@Test(expected = MetaException.class)
public void testListPartitionValuesNoTable() throws Exception {
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);
}
use of org.apache.hadoop.hive.metastore.api.PartitionValuesRequest in project hive by apache.
the class TestListPartitions method testListPartitionValues.
/**
* Testing listPartitionValues(PartitionValuesRequest) ->
* get_partition_values(PartitionValuesRequest).
* @throws Exception
*/
@Test
public void testListPartitionValues() throws Exception {
List<List<String>> testValues = createTable4PartColsParts(client);
List<FieldSchema> partitionSchema = Lists.newArrayList(new FieldSchema("yyyy", "string", ""), new FieldSchema("mm", "string", ""));
PartitionValuesRequest request = new PartitionValuesRequest(DB_NAME, TABLE_NAME, partitionSchema);
PartitionValuesResponse response = client.listPartitionValues(request);
assertCorrectPartitionValuesResponse(testValues, response);
}
use of org.apache.hadoop.hive.metastore.api.PartitionValuesRequest in project hive by apache.
the class TestListPartitions method testListPartitionValuesNullSchema.
@Test
public void testListPartitionValuesNullSchema() throws Exception {
try {
createTable4PartColsParts(client);
PartitionValuesRequest request = new PartitionValuesRequest(DB_NAME, TABLE_NAME, null);
client.listPartitionValues(request);
fail("Should have thrown exception");
} catch (NullPointerException | TProtocolException e) {
// TODO: should not throw different exceptions for different HMS deployment types
}
}
use of org.apache.hadoop.hive.metastore.api.PartitionValuesRequest in project hive by apache.
the class TestListPartitions method testListPartitionValuesNullTblName.
@Test
public void testListPartitionValuesNullTblName() throws Exception {
try {
createTable4PartColsParts(client);
List<FieldSchema> partitionSchema = Lists.newArrayList(new FieldSchema("yyyy", "string", ""), new FieldSchema("mm", "string", ""));
PartitionValuesRequest request = new PartitionValuesRequest(DB_NAME, null, partitionSchema);
client.listPartitionValues(request);
fail("Should have thrown exception");
} catch (NullPointerException | TProtocolException e) {
// TODO: should not throw different exceptions for different HMS deployment types
}
}
Aggregations