use of org.apache.hadoop.hive.metastore.api.Partition in project hive by apache.
the class TestAppendPartitions method createPartition.
private void createPartition(Table table, List<String> values) throws Exception {
Partition partition = new PartitionBuilder().fromTable(table).setValues(values).build();
client.add_partition(partition);
}
use of org.apache.hadoop.hive.metastore.api.Partition in project hive by apache.
the class TestGetPartitions method testGetPartitionByValues.
/**
* Testing getPartition(String,String,List(String)) ->
* get_partition(String,String,List(String)).
* @throws Exception
*/
@Test
public void testGetPartitionByValues() throws Exception {
createTable3PartCols1Part(client);
List<String> parts = Lists.newArrayList("1997", "05", "16");
Partition partition = client.getPartition(DB_NAME, TABLE_NAME, parts);
assertNotNull(partition);
assertEquals(parts, partition.getValues());
}
use of org.apache.hadoop.hive.metastore.api.Partition in project hive by apache.
the class TestGetPartitions method testGetPartitionWithAuthInfo.
@Test
public void testGetPartitionWithAuthInfo() throws Exception {
createTable3PartCols1PartAuthOn(client);
Partition partition = client.getPartitionWithAuthInfo(DB_NAME, TABLE_NAME, Lists.newArrayList("1997", "05", "16"), "user0", Lists.newArrayList("group0"));
assertNotNull(partition);
assertAuthInfoReturned("user0", "group0", partition);
}
use of org.apache.hadoop.hive.metastore.api.Partition in project hive by apache.
the class TestGetPartitions method testGetPartitionWithAuthInfoEmptyUserGroup.
@Test
public void testGetPartitionWithAuthInfoEmptyUserGroup() throws Exception {
createTable3PartCols1PartAuthOn(client);
Partition partition = client.getPartitionWithAuthInfo(DB_NAME, TABLE_NAME, Lists.newArrayList("1997", "05", "16"), "", Lists.newArrayList(""));
assertNotNull(partition);
assertAuthInfoReturned("", "", partition);
}
use of org.apache.hadoop.hive.metastore.api.Partition in project hive by apache.
the class TestGetPartitions method testGetPartitionWithAuthInfoNoPrivilagesSet.
/**
* Testing getPartitionWithAuthInfo(String,String,List(String),String,List(String)) ->
* get_partition_with_auth(String,String,List(String),String,List(String)).
* @throws Exception
*/
@Test
public void testGetPartitionWithAuthInfoNoPrivilagesSet() throws Exception {
createTable3PartCols1Part(client);
Partition partition = client.getPartitionWithAuthInfo(DB_NAME, TABLE_NAME, Lists.newArrayList("1997", "05", "16"), "", Lists.newArrayList());
assertNotNull(partition);
assertNull(partition.getPrivileges());
}
Aggregations