protected byte[][] extractKeyValues(Result r) {
    byte[][] keyVals = null;
    ArrayList<byte[]> foundList = new ArrayList<>();
    int numCols = columns.length;
    if (numCols > 0) {
      for (Cell value : r.listCells()) {
        byte[] column =
          CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value));
        for (int i = 0; i < numCols; i++) {
          if (Bytes.equals(column, columns[i])) {
            foundList.add(CellUtil.cloneValue(value));
            break;
          }
        }
      }
      if (foundList.size() == numCols) {
        keyVals = foundList.toArray(new byte[numCols][]);
      }
    }
    return keyVals;
  }
Extract columns values from the current record. This method returns null if any of the columns
are not found.
<p>
Override this method if you want to deal with nulls differently.
@param r The current values.
@return Array of byte values.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/GroupingTableMapper.java