Search in sources :

Example 1 with HiveTablePartition

use of com.thinkbiganalytics.metadata.rest.model.data.HiveTablePartition 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();
}
Also used : DataOperation(com.thinkbiganalytics.metadata.rest.model.op.DataOperation) HiveTablePartition(com.thinkbiganalytics.metadata.rest.model.data.HiveTablePartition) HiveTablePartitions(com.thinkbiganalytics.metadata.rest.model.op.HiveTablePartitions) Dataset(com.thinkbiganalytics.metadata.rest.model.op.Dataset) DateTime(org.joda.time.DateTime) Feed(com.thinkbiganalytics.metadata.rest.model.feed.Feed) FeedExecutedSinceFeed(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed) HiveTableDatasource(com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)

Aggregations

FeedExecutedSinceFeed (com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed)1 HiveTableDatasource (com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)1 HiveTablePartition (com.thinkbiganalytics.metadata.rest.model.data.HiveTablePartition)1 Feed (com.thinkbiganalytics.metadata.rest.model.feed.Feed)1 DataOperation (com.thinkbiganalytics.metadata.rest.model.op.DataOperation)1 Dataset (com.thinkbiganalytics.metadata.rest.model.op.Dataset)1 HiveTablePartitions (com.thinkbiganalytics.metadata.rest.model.op.HiveTablePartitions)1 DateTime (org.joda.time.DateTime)1