private static Map<String, Object> transformToPigMap(Map<?, ?> map, HCatFieldSchema hfs) throws Exception {
    if (map == null) {
      return null;
    }

    Map<String, Object> result = new HashMap<String, Object>();
    for (Entry<?, ?> entry : map.entrySet()) {
      // since map key for Pig has to be Strings
      if (entry.getKey()!=null) {
        result.put(entry.getKey().toString(), extractPigObject(entry.getValue(), hfs.getMapValueSchema().get(0)));
      }
    }
    return result;
  }
Converts object from Hive's value system to Pig's value system
see HCatBaseStorer#getJavaObj() for Pig->Hive conversion 
@param o object from Hive value system
@return object in Pig value system
hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/PigHCatUtil.java