public void addColumnScalarOperationCheckedTestCases(boolean op1IsCol, String vectorExpClassName,
      String inputColumnVectorType, String outputColumnVectorType, String scalarType,
      boolean isReturnTypeLong)
      throws IOException {

    TestSuiteClassName template =
        TestSuiteClassName.TestColumnScalarOperationVectorExpressionCheckedEvaluation;

    //Read the template into a string;
    String templateFile = GenVectorCode.joinPath(this.testTemplateDirectory,template.toString()+".txt");
    String templateString = removeTemplateComments(GenVectorCode.readFile(templateFile));
    String[] outputTypeInfos = null;
    if (isReturnTypeLong) {
      outputTypeInfos = new String[] {"tinyint", "smallint", "int", "bigint"};
    } else {
      outputTypeInfos = new String[] {"float", "double"};
    }
    for (String outputTypeInfo : outputTypeInfos) {
      for (Boolean[] testMatrix : new Boolean[][] {
          // Pairwise: InitOuputColHasNulls, InitOuputColIsRepeating, ColumnHasNulls, ColumnIsRepeating
          { false, true, true, true }, { false, false, false, false }, { true, false, true, false },
          { true, true, false, false }, { true, false, false, true } }) {
        String testCase = templateString;
        testCase = testCase.replaceAll("<TestName>",
            "test" + vectorExpClassName
                + createNullRepeatingNameFragment("Out", testMatrix[0], testMatrix[1])
                + createNullRepeatingNameFragment("Col", testMatrix[2], testMatrix[3])
                + createOutputTypeInfoFragment("Ret", outputTypeInfo));
        testCase = testCase.replaceAll("<OutputTypeInfo>", outputTypeInfo);
        testCase = testCase.replaceAll("<VectorExpClassName>", vectorExpClassName);
        testCase = testCase.replaceAll("<InputColumnVectorType>", inputColumnVectorType);
        testCase = testCase.replaceAll("<OutputColumnVectorType>", outputColumnVectorType);
        testCase = testCase.replaceAll("<ScalarType>", scalarType);
        testCase = testCase.replaceAll("<CamelCaseScalarType>", GenVectorCode.getCamelCaseType(scalarType));
        testCase = testCase.replaceAll("<InitOuputColHasNulls>", testMatrix[0].toString());
        testCase = testCase.replaceAll("<InitOuputColIsRepeating>", testMatrix[1].toString());
        testCase = testCase.replaceAll("<ColumnHasNulls>", testMatrix[2].toString());
        testCase = testCase.replaceAll("<ColumnIsRepeating>", testMatrix[3].toString());

        if (op1IsCol) {
          testCase = testCase.replaceAll("<ConstructorParams>", "0, scalarValue");
        } else {
          testCase = testCase.replaceAll("<ConstructorParams>", "scalarValue, 0");
        }

        testsuites.get(template).append(testCase);
      }
    }
  }
GenVectorTestCode.
This class is mutable and maintains a hashmap of TestSuiteClassName to test cases.
The tests cases are added over the course of vectorized expressions class generation,
with test classes being outputted at the end. For each column vector (inputs and/or outputs)
a matrix of pairwise covering Booleans is used to generate test cases across nulls and
repeating dimensions. Based on the input column vector(s) nulls and repeating states
the states of the output column vector (if there is one) is validated, along with the null
vector. For filter operations the selection vector is validated against the generated
data. Each template corresponds to a class representing a test suite.
vector-code-gen/src/org/apache/hadoop/hive/tools/GenVectorTestCode.java