if (!table.isSubselect()) {
ProjectedPTableWrapper projectedTable = table.createProjectedTable(!asSubquery);
TupleProjector.serializeProjectorIntoScan(context.getScan(), projectedTable.createTupleProjector());
context.setCurrentTable(table.getTableRef());
context.setResolver(projectedTable.createColumnResolver());
table.projectColumns(context.getScan());
return compileSingleQuery(context, subquery, binds, asSubquery, true);
}
QueryPlan plan = compileSubquery(subquery);
ProjectedPTableWrapper projectedTable = table.createProjectedTable(plan.getProjector());
context.setResolver(projectedTable.createColumnResolver());