private static void validateParameters(Scan scan, boolean canFamilyBeAbsent) throws IOException {
    if (
      scan == null
        || (Bytes.equals(scan.getStartRow(), scan.getStopRow())
          && !Bytes.equals(scan.getStartRow(), HConstants.EMPTY_START_ROW))
        || ((Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0)
          && !Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW))
    ) {
      throw new IOException("Agg client Exception: Startrow should be smaller than Stoprow");
    } else if (!canFamilyBeAbsent) {
      if (scan.getFamilyMap().size() != 1) {
        throw new IOException("There must be only one family.");
      }
    }
  }
@param scan              the HBase scan object to use to read data from HBase
@param canFamilyBeAbsent whether column family can be absent in familyMap of scan
hbase-endpoint/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationHelper.java