private static void generateKeyStruct(Map<String, String> compositeKeyParts, StringBuilder sb) {
    sb.append("struct<");

    for (Entry<String, String> entry : compositeKeyParts.entrySet()) {
      sb.append(entry.getKey()).append(":").append(entry.getValue()).append(",");
    }

    // trim the trailing ","
    trim(sb);
    sb.append(">");
  }
Auto-generates the key struct for composite keys

@param compositeKeyParts map of composite key part name to its type. Usually this would be
         provided by the custom implementation of {@link HBaseCompositeKey composite key}
@param sb StringBuilder object to construct the struct
hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseSerDeHelper.java