return multiGetRequest;
}
private FlatProjectorChain getFlatProjectorChain(ProjectionToProjectorVisitor projectionToProjectorVisitor,
ESGetNode node) {
FlatProjectorChain projectorChain = null;
if (node.limit() != null || node.offset() > 0 || !node.sortSymbols().isEmpty()) {
List<Symbol> orderBySymbols = new ArrayList<>(node.sortSymbols().size());
for (Symbol symbol : node.sortSymbols()) {
int i = node.outputs().indexOf(symbol);
if (i < 0 ) {
orderBySymbols.add(new InputColumn(node.outputs().size() + orderBySymbols.size()));
} else {
orderBySymbols.add(new InputColumn(i));
}
}
TopNProjection topNProjection = new TopNProjection(
com.google.common.base.Objects.firstNonNull(node.limit(), Constants.DEFAULT_SELECT_LIMIT),
node.offset(),
orderBySymbols,
node.reverseFlags(),
node.nullsFirst()
);
topNProjection.outputs(genInputColumns(node.outputs().size()));
projectorChain = new FlatProjectorChain(
Arrays.<Projection>asList(topNProjection),
projectionToProjectorVisitor
);
}
return projectorChain;