@Override public List<Mutation> toRowMutations() { // TODO: change to List<Mutation> once it implements Row List<Mutation> mutations = new ArrayList<Mutation>(3); if (deleteRow != null) { // Include only deleteRow mutation if present because it takes precedence over all others mutations.add(deleteRow); } else { // Because we cannot enforce a not null constraint on a KV column (since we don't know if // the row exists when // we upsert it), se instead add a KV that is always emtpy. This allows us to imitate SQL // semantics given the // way HBase works. setValues.add( SchemaUtil.getEmptyColumnFamily(getColumnFamilies()), QueryConstants.EMPTY_COLUMN_BYTES, ts, ByteUtil.EMPTY_BYTE_ARRAY); mutations.add(setValues); if (!unsetValues.isEmpty()) { mutations.add(unsetValues); } } return mutations; }