public Object[] randomRow() {

    final Object row[] = new Object[columnCount];

    if (generationSpecList == null) {
      for (int c = 0; c < columnCount; c++) {
        row[c] = randomWritable(c);
      }
    } else {
      for (int c = 0; c < columnCount; c++) {
        GenerationSpec generationSpec = generationSpecList.get(c);
        GenerationSpec.GenerationKind generationKind = generationSpec.getGenerationKind();
        Object object;
        switch (generationKind) {
        case SAME_TYPE:
          object = randomWritable(c, generationSpec.getColumnAllowNulls());
          break;
        case OMIT_GENERATION:
          object = null;
          break;
        case STRING_FAMILY:
        {
          TypeInfo typeInfo = generationSpec.getTypeInfo();
          StringGenerationOption stringGenerationOption =
              generationSpec.getStringGenerationOption();
          object = randomStringFamily(
              r, typeInfo, stringGenerationOption, true);
        }
        break;
        case STRING_FAMILY_OTHER_TYPE_VALUE:
          {
            TypeInfo typeInfo = generationSpec.getTypeInfo();
            TypeInfo otherTypeTypeInfo = generationSpec.getSourceTypeInfo();
            object = randomStringFamilyOtherTypeValue(
                r, typeInfo, otherTypeTypeInfo, true);
          }
          break;
        case TIMESTAMP_MILLISECONDS:
          {
            LongWritable longWritable = (LongWritable) randomWritable(c);
            if (longWritable != null) {

              while (true) {
                long longValue = longWritable.get();
                if (longValue >= MIN_FOUR_DIGIT_YEAR_MILLIS &&
                    longValue <= MAX_FOUR_DIGIT_YEAR_MILLIS) {
                  break;
                }
                longWritable.set(
                    (Long) VectorRandomRowSource.randomPrimitiveObject(
                        r, TypeInfoFactory.longTypeInfo));
              }
            }
            object = longWritable;
          }
          break;
        case VALUE_LIST:
          {
            List<Object> valueList = generationSpec.getValueList();
            final int valueCount = valueList.size();

            TypeInfo typeInfo = generationSpec.getTypeInfo();
            Category category = typeInfo.getCategory();
            switch (category) {
            case PRIMITIVE:
            case STRUCT:
              object = valueList.get(r.nextInt(valueCount));
              break;
            case LIST:
              {
                final int elementCount = r.nextInt(valueCount);

                ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo;
                TypeInfo elementTypeInfo = listTypeInfo.getListElementTypeInfo();
                final ObjectInspector elementObjectInspector =
                    TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(
                        elementTypeInfo); 
                List<Object> list = new ArrayList<Object>(elementCount);
                for (int i = 0; i < elementCount; i++) {
                  Object elementWritable =
                      randomWritable(elementTypeInfo, elementObjectInspector,
                          allowNull);
                  list.add(elementWritable);
                }
                object = list;
              }
              break;
            case MAP:
              {
                final int elementCount = r.nextInt(valueCount);

                MapTypeInfo mapTypeInfo = (MapTypeInfo) typeInfo;
                TypeInfo valueTypeInfo = mapTypeInfo.getMapValueTypeInfo();
                final ObjectInspector valueObjectInspector =
                    TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(
                        valueTypeInfo);
                Map<Object,Object> map = new HashMap<Object,Object>(elementCount);
                for (int i = 0; i < elementCount; i++) {
                  Object key = valueList.get(r.nextInt(valueCount));
                  Object valueWritable =
                      randomWritable(valueTypeInfo, valueObjectInspector,
                          allowNull);
                  if (!map.containsKey(key)) {
                    map.put(
                        key,
                        valueWritable);
                  }
                }
                object = map;
              }
              break;
            default:
              throw new RuntimeException("Unexpected category " + category);
            }
          }
          break;
        default:
          throw new RuntimeException("Unexpected generationKind " + generationKind);
        }
        row[c] = object;
      }
    }
    return row;
  }
Generate object inspector and random row object[].
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/VectorRandomRowSource.java