OverwritePlanner implements BulkPlanner, ProvidesAlias { @Override public List<Tuple2<MutationType, Dataset<Row>>> planMutationsForSet(Dataset<Row> arriving) { Tuple2<MutationType, Dataset<Row>> mutation = new Tuple2<>(MutationType.OVERWRITE, arriving); List<Tuple2<MutationType, Dataset<Row>>> mutations = new ArrayList<>(); mutations.add(mutation); return mutations; }  @Override void configure(Config config); @Override List<Tuple2<MutationType, Dataset<Row>>> planMutationsForSet(Dataset<Row> arriving); @Override Set<MutationType> getEmittedMutationTypes(); @Override String getAlias();  }
@Test public void testPlanner() { Dataset<Row> testData = Contexts.getSparkSession().sql("SELECT 'test'"); BulkPlanner planner = new OverwritePlanner(); List<Tuple2<MutationType, Dataset<Row>>> plan = planner.planMutationsForSet(testData); assertEquals(plan.size(), 1); assertEquals(plan.get(0)._1(), MutationType.OVERWRITE); assertEquals(plan.get(0)._2(), testData); }