public static Object randomStringFamily(Random random, TypeInfo typeInfo,
      StringGenerationOption stringGenerationOption, boolean isWritable) {

    String string;
    if (stringGenerationOption == null) {
      string =
          VectorRandomRowSource.randomPrimitiveObject(
              random, (PrimitiveTypeInfo) typeInfo).toString();
    } else {
      boolean generateSentences = stringGenerationOption.getGenerateSentences();
      boolean addPadding = stringGenerationOption.getAddPadding();
      StringBuilder sb = new StringBuilder();
      if (addPadding && random.nextBoolean()) {
        sb.append(StringUtils.leftPad("", random.nextInt(5)));
      }
      if (generateSentences) {
        boolean capitalizeFirstWord = random.nextBoolean();
        final int n = random.nextInt(10);
        for (int i = 0; i < n; i++) {
          String randomWord = randomWords[random.nextInt(randomWordCount)];
          if (randomWord.length() > 0 &&
              ((i == 0 && capitalizeFirstWord) || random.nextInt(20) == 0)) {
            randomWord = Character.toUpperCase(randomWord.charAt(0)) + randomWord.substring(1);
          }
          if (i > 0) {
            sb.append(" ");
          }
          sb.append(randomWord);
        }
      } else {
        sb.append(
            VectorRandomRowSource.randomPrimitiveObject(
                random, (PrimitiveTypeInfo) typeInfo).toString());
      }
      if (addPadding && random.nextBoolean()) {
        sb.append(StringUtils.leftPad("", random.nextInt(5)));
      }
      string = sb.toString();
    }
    return toStringFamilyObject(typeInfo, string, isWritable);
  }
Generate object inspector and random row object[].
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/VectorRandomRowSource.java