ESDeleteByQueryNode node = new ESDeleteByQueryNode(
new String[]{"characters"},
new WhereClause(whereClause));
Plan plan = new Plan();
plan.add(node);
Job job = executor.newJob(plan);
ESDeleteByQueryTask task = (ESDeleteByQueryTask) job.tasks().get(0);
task.start();
TaskResult taskResult = task.result().get(0).get();
Object[][] rows = taskResult.rows();
assertThat(rows.length, is(0));
assertThat(taskResult.rowCount(), is(-1L));
// verify deletion
DocTableInfo characters = docSchemaInfo.getTableInfo("characters");
QueryThenFetchNode searchNode = new QueryThenFetchNode(
characters.getRouting(WhereClause.MATCH_ALL),
Arrays.<Symbol>asList(id_ref, name_ref),
Arrays.<Symbol>asList(name_ref),
new boolean[]{false},
new Boolean[] { null },
null, null,
new WhereClause(whereClause),
null
);
plan = new Plan();
plan.add(searchNode);
job = executor.newJob(plan);
QueryThenFetchTask searchTask = (QueryThenFetchTask) job.tasks().get(0);
searchTask.start();
rows = searchTask.result().get(0).get().rows();
assertThat(rows.length, is(0));
}