Dataset<Record> outputDataset = repo.create("ns", "out", new DatasetDescriptor.Builder()
.schema(USER_SCHEMA).partitionStrategy(partitionStrategy).build());
writeTestUsers(inputDataset, 10);
URI sourceViewUri = new URIBuilder(repo.getUri(), "ns", "in").with("username",
"test-0").build();
View<Record> inputView = Datasets.<Record, Dataset<Record>> load(sourceViewUri,
Record.class);
Assert.assertEquals(1, datasetSize(inputView));
Pipeline pipeline = new MRPipeline(TestCrunchDatasets.class);
PCollection<GenericData.Record> data = pipeline.read(CrunchDatasets
.asSource(sourceViewUri, GenericData.Record.class));
URI targetViewUri = new URIBuilder(repo.getUri(), "ns", "out").with(
"email", "email-0").build();
pipeline.write(data, CrunchDatasets.asTarget(targetViewUri),
Target.WriteMode.APPEND);
pipeline.run();