}
@Override
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
FirstLastNthValueDataContainer payload = new FirstLastNthValueDataContainer();
payload.setIsAscending(isAscending);
payload.setFixedWidthOrderValues(orderByColumn.getDataType().isFixedWidth());
payload.setFixedWidthDataValues(dataColumn.getDataType().isFixedWidth());
if (useOffset) {
payload.setOffset(offset);
if (topValues.size() == 0) {
return false;
}
} else {
if (topValue == null) {
return false;
}
topValues.put(topOrder.getValue(), topValue);
}
payload.setData(topValues);
try {
ptr.set(payload.getPayload());
} catch (IOException ex) {
logger.error(ex.getMessage());
return false;
}
return true;