public static HCatSplit castToHCatSplit(InputSplit split) throws IOException {
    if (split instanceof HCatSplit) {
      return (HCatSplit) split;
    } else {
      throw new IOException("Split must be " + HCatSplit.class.getName()
        + " but found " + split.getClass().getName());
    }
  }
Casts an InputSplit into a HCatSplit, providing a useful error message if the cast fails.
@param split the InputSplit
@return the HCatSplit
@throws IOException
hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/InternalUtil.java