public ParallelIterators(StatementContext context, TableRef tableRef, FilterableStatement statement, RowProjector projector, GroupBy groupBy, Integer limit, ParallelIteratorFactory iteratorFactory) throws SQLException {
super(context, tableRef, groupBy);
this.splits = getSplits(context, tableRef, statement.getHint());
this.iteratorFactory = iteratorFactory;
Scan scan = context.getScan();
PTable table = tableRef.getTable();
if (projector.isProjectEmptyKeyValue()) {
Map<byte [], NavigableSet<byte []>> familyMap = scan.getFamilyMap();
if (familyMap.isEmpty() && table.getColumnFamilies().size() == 1) {
scan.addFamily(table.getColumnFamilies().get(0).getName().getBytes());
ScanUtil.andFilterAtBeginning(scan, new FirstKeyOnlyFilter());
} else {
byte[] ecf = SchemaUtil.getEmptyColumnFamily(table.getColumnFamilies());
if (!familyMap.containsKey(ecf) || familyMap.get(ecf) != null) {
scan.addColumn(ecf, QueryConstants.EMPTY_COLUMN_BYTES);
}
}
}
if (limit != null) {
ScanUtil.andFilterAtEnd(scan, new PageFilter(limit));
}
}