@Override
protected MutationState mutate(StatementContext context, ResultIterator iterator, PhoenixConnection connection) throws SQLException {
PhoenixStatement statement = new PhoenixStatement(connection);
// Clone the connection as it's not thread safe and will be operated on in parallel
if (context.getSequenceManager().getSequenceCount() > 0) {
iterator = new SequenceResultIterator(iterator,context.getSequenceManager());
}
return upsertSelect(statement, tableRef, projector, iterator, columnIndexes, pkSlotIndexes);
}