private static ResourceFieldSchema getResourceSchemaFromFieldSchema(HCatFieldSchema hfs)
    throws IOException {
    ResourceFieldSchema rfSchema;
    // if we are dealing with a bag or tuple column - need to worry about subschema
    if (hfs.getType() == Type.STRUCT) {
      rfSchema = new ResourceFieldSchema()
        .setName(hfs.getName())
        .setDescription(hfs.getComment())
        .setType(getPigType(hfs))
        .setSchema(getTupleSubSchema(hfs));
    } else if (hfs.getType() == Type.ARRAY) {
      rfSchema = new ResourceFieldSchema()
        .setName(hfs.getName())
        .setDescription(hfs.getComment())
        .setType(getPigType(hfs))
        .setSchema(getBagSubSchema(hfs));
    } else {
      rfSchema = new ResourceFieldSchema()
        .setName(hfs.getName())
        .setDescription(hfs.getComment())
        .setType(getPigType(hfs))
        .setSchema(null); // no munging inner-schemas
    }
    return rfSchema;
  }
Determine if the current Pig version supports boolean columns. This works around a
dependency conflict preventing HCatalog from requiring a version of Pig with boolean
field support and should be removed once HCATALOG-466 has been resolved.
hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/PigHCatUtil.java