use of io.crate.planner.MultiPhasePlan in project crate by crate.
the class SubSelectSymbolReplacerTest method testSelectSymbolsAreReplacedInSelectListOfPrimaryKeyLookups.
@Test
public void testSelectSymbolsAreReplacedInSelectListOfPrimaryKeyLookups() throws Exception {
MultiPhasePlan plan = e.plan("select (select 'foo' from sys.cluster) from users where id = 10");
ESGet esGet = (ESGet) plan.rootPlan();
SelectSymbol subSelect = (SelectSymbol) esGet.outputs().get(0);
SubSelectSymbolReplacer replacer = new SubSelectSymbolReplacer(esGet, subSelect);
replacer.onSuccess(new BytesRef("foo"));
assertThat(esGet.outputs(), contains(isLiteral("foo")));
}
Aggregations