public T[] generateBatch(BatchDataDistribution dist) {

      Object[] batch = new Object[VectorizedRowBatch.DEFAULT_SIZE];

      for (int i = 0; i < batch.length; i++) {
        switch (dist) {
        case AllValues:
          if (possibleNonRandomValueGenerated % 73 == 0) {
            batch[i] = null;
          } else if (fixedPointValues != null && possibleNonRandomValueGenerated % 233 == 0) {
            batch[i] = fixedPointValues[rand.nextInt(fixedPointValues.length)];
          } else {
            batch[i] = generateRandomNonNullValue(rand);
          }
          possibleNonRandomValueGenerated++;
          break;

        case NoNulls:
          if (fixedPointValues != null && possibleNonRandomValueGenerated % 233 == 0) {
            batch[i] = fixedPointValues[rand.nextInt(fixedPointValues.length)];
          } else {
            batch[i] = generateRandomNonNullValue(rand);
          }
          possibleNonRandomValueGenerated++;
          break;

        case RepeatingNull:
          batch[i] = null;
          break;

        case RepeatingValue:
          if (i == 0) {
            batch[i] = generateRandomNonNullValue(rand);
          } else {
            batch[i] = batch[0];
          }
          break;

        default:
          throw new UnsupportedOperationException(
              dist.toString() + " data distribution is not implemented.");
        }
      }

      return (T[]) batch;
    }
Base class for type specific batch generators. Each type specific batch generator implements
generateRandomNonNullValue to generate random values, and initializeFixedPointValues to
specify a set of fixed values within the data (this is useful when defining query predicates)
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/util/OrcFileGenerator.java