use of org.apache.hadoop.hive.metastore.client.builder.PartitionBuilder in project hive by apache.
the class TestAddPartitionsFromPartSpec method testAddPartitionSpecNoValue.
@Test(expected = MetaException.class)
public void testAddPartitionSpecNoValue() throws Exception {
createTable();
Partition partition = new PartitionBuilder().setDbName(DB_NAME).setTableName(TABLE_NAME).addCol(YEAR_COL_NAME, DEFAULT_COL_TYPE).setLocation(metaStore.getWarehouseRoot() + "/addpartspectest").build();
PartitionSpecProxy partitionSpecProxy = buildPartitionSpec(DB_NAME, TABLE_NAME, null, Lists.newArrayList(partition));
client.add_partitions_pspec(partitionSpecProxy);
}
use of org.apache.hadoop.hive.metastore.client.builder.PartitionBuilder in project hive by apache.
the class TestAlterPartitions method testAlterPartitionsIncompletePartitionVals.
@Test(expected = MetaException.class)
public void testAlterPartitionsIncompletePartitionVals() throws Exception {
createTable4PartColsParts(client);
Table t = client.getTable(DB_NAME, TABLE_NAME);
PartitionBuilder builder = new PartitionBuilder();
Partition part = builder.fromTable(t).addValue("2017").build();
Partition part1 = client.listPartitions(DB_NAME, TABLE_NAME, (short) -1).get(0);
client.alter_partitions(DB_NAME, TABLE_NAME, Lists.newArrayList(part, part1));
}
use of org.apache.hadoop.hive.metastore.client.builder.PartitionBuilder in project hive by apache.
the class TestAlterPartitions method addPartition.
private static void addPartition(IMetaStoreClient client, Table table, List<String> values) throws TException {
PartitionBuilder partitionBuilder = new PartitionBuilder().fromTable(table);
values.forEach(val -> partitionBuilder.addValue(val));
client.add_partition(partitionBuilder.build());
}
use of org.apache.hadoop.hive.metastore.client.builder.PartitionBuilder in project hive by apache.
the class TestAlterPartitions method testAlterPartitionIncompletePartitionVals.
@Test(expected = MetaException.class)
public void testAlterPartitionIncompletePartitionVals() throws Exception {
createTable4PartColsParts(client);
Table t = client.getTable(DB_NAME, TABLE_NAME);
PartitionBuilder builder = new PartitionBuilder();
Partition part = builder.fromTable(t).addValue("2017").build();
client.alter_partition(DB_NAME, TABLE_NAME, part);
}
use of org.apache.hadoop.hive.metastore.client.builder.PartitionBuilder in project hive by apache.
the class TestAlterPartitions method testAlterPartitionsWithEnvironmentCtxIncompletePartitionVals.
@Test(expected = MetaException.class)
public void testAlterPartitionsWithEnvironmentCtxIncompletePartitionVals() throws Exception {
createTable4PartColsParts(client);
Table t = client.getTable(DB_NAME, TABLE_NAME);
PartitionBuilder builder = new PartitionBuilder();
Partition part = builder.fromTable(t).addValue("2017").build();
Partition part1 = client.listPartitions(DB_NAME, TABLE_NAME, (short) -1).get(0);
client.alter_partitions(DB_NAME, TABLE_NAME, Lists.newArrayList(part, part1), new EnvironmentContext());
}
Aggregations