use of com.thinkbiganalytics.metadata.rest.model.op.HiveTablePartitions in project kylo by Teradata.
the class MetadataClientTest method testCompleteOperation.
// @Test
public void testCompleteOperation() throws ParseException {
Feed feedA = buildFeed("category", "feedA").post();
HiveTableDatasource dsA = buildHiveTableDatasource("test-table").post();
feedA = client.addDestination(feedA.getId(), dsA.getId());
Feed feedB = buildFeed("category", "feedB", "category", "feedA").post();
feedB = client.addSource(feedB.getId(), dsA.getId());
String destA = feedA.getDestinations().iterator().next().getId();
DataOperation op = client.beginOperation(destA, "");
op.setState(State.SUCCESS);
HiveTablePartitions changeSet = new HiveTablePartitions();
changeSet.setPartitions(Arrays.asList(new HiveTablePartition("month", null, "Jan", "Feb"), new HiveTablePartition("year", null, "2015", "2016")));
Dataset dataset = new Dataset(new DateTime(), dsA, ChangeType.UPDATE, ContentType.PARTITIONS, changeSet);
op.setDataset(dataset);
op = client.updateDataOperation(op);
assertThat(op).isNotNull();
}
Aggregations