private String getRandomTypeName(SupportedTypes supportedTypes) {
    String typeName = null;
    if (r.nextInt(10 ) != 0) {
      typeName = possibleHivePrimitiveTypeNames[r.nextInt(possibleHivePrimitiveTypeNames.length)];
    } else {
      switch (supportedTypes) {
      case PRIMITIVE:
        typeName = possibleHivePrimitiveTypeNames[r.nextInt(possibleHivePrimitiveTypeNames.length)];
        break;
      case ALL_EXCEPT_MAP:
        typeName = possibleHiveComplexTypeNames[r.nextInt(possibleHiveComplexTypeNames.length - 1)];
        break;
      case ALL:
        typeName = possibleHiveComplexTypeNames[r.nextInt(possibleHiveComplexTypeNames.length)];
        break;
      }
    }
    return typeName;
  }
Generate object inspector and random row object[].
serde/src/test/org/apache/hadoop/hive/serde2/SerdeRandomRowSource.java