public static HiveChar getRandHiveChar(Random r, CharTypeInfo charTypeInfo) {
    final int maxLength = 1 + r.nextInt(charTypeInfo.getLength());
    final String randomString = RandomTypeUtil.getRandString(r, "abcdefghijklmnopqrstuvwxyz", 100);
    final HiveChar hiveChar = new HiveChar(randomString, maxLength);
    return hiveChar;
  }
Generate object inspector and random row object[].
serde/src/test/org/apache/hadoop/hive/serde2/SerdeRandomRowSource.java