public static Object[] randomWritablePrimitiveRow(int columnCount, Random r,
      PrimitiveTypeInfo[] primitiveTypeInfos,
      DataTypePhysicalVariation[] dataTypePhysicalVariations) {

    final Object row[] = new Object[columnCount];
    for (int c = 0; c < columnCount; c++) {
      final PrimitiveTypeInfo primitiveTypeInfo = primitiveTypeInfos[c];
      final DataTypePhysicalVariation dataTypePhysicalVariation =
          (dataTypePhysicalVariations != null ?
              dataTypePhysicalVariations[c] : DataTypePhysicalVariation.NONE);
      final ObjectInspector objectInspector;
      if (primitiveTypeInfo instanceof DecimalTypeInfo &&
          dataTypePhysicalVariation == DataTypePhysicalVariation.DECIMAL_64) {
        objectInspector =
            PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(
                TypeInfoFactory.longTypeInfo);
      } else {
        objectInspector =
            PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(
                primitiveTypeInfo);
      }
      final Object object = randomPrimitiveObject(r, primitiveTypeInfo);
      row[c] = getWritablePrimitiveObject(primitiveTypeInfo, objectInspector, object);
    }
    return row;
  }
Generate object inspector and random row object[].
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/VectorRandomRowSource.java