public void testInsertFromSubQueryESGet() throws Exception {
// doesn't use ESGetNode but CollectNode.
// Round-trip to handler can be skipped by writing from the shards directly
Plan plan = plan("insert into users (date, id, name) (select date, id, name from users where id=1)");
Iterator<PlanNode> iterator = plan.iterator();
PlanNode planNode = iterator.next();
assertThat(planNode, instanceOf(CollectNode.class));
CollectNode collectNode = (CollectNode) planNode;
assertThat(collectNode.projections().size(), is(1));
assertThat(collectNode.projections().get(0), instanceOf(ColumnIndexWriterProjection.class));