public ResultScanner getResultScanner(final Mapping mapping,
final WithArgs withArgs,
final HTableInterface table) throws HBqlException {
final IndexedTable index = (IndexedTable)table;
byte[] startKey = null;
byte[] stopKey = null;
if (this.getStartRow() != HConstants.EMPTY_START_ROW) {
final TableMapping tableMapping = (TableMapping)mapping;
tableMapping.validateKeyInfo(withArgs.getIndexName());
final int width = tableMapping.getKeyInfo().getWidth();
startKey = Bytes.add(this.getStartRow(), Util.getFixedWidthString(Character.MIN_VALUE, width));
}
if (this.getStopRow() != HConstants.EMPTY_END_ROW) {
final TableMapping tableMapping = (TableMapping)mapping;
tableMapping.validateKeyInfo(withArgs.getIndexName());
final int width = tableMapping.getKeyInfo().getWidth();
stopKey = Bytes.add(this.getStopRow(), Util.getFixedWidthString(Character.MAX_VALUE, width));
}
try {
return index.getIndexedScanner(withArgs.getIndexName(),
startKey,
stopKey,
withArgs.getColumnsUsedInIndexWhereExpr(),
withArgs.getFilterForTableIndex(),
getColumns());