@Override
  public void evaluate(VectorizedRowBatch batch) throws HiveException {

    // return immediately if batch is empty
    final int n = batch.size;
    if (n == 0) {
      return;
    }

    if (childExpressions != null) {
      super.evaluateChildren(batch);
    }

    ColumnVector outV = batch.cols[outputColumnNum];
    int[] sel = batch.selected;
    StructColumnVector structColumnVector = (StructColumnVector) batch.cols[inputColumnNum[0]];
    ColumnVector fieldColumnVector = structColumnVector.fields[fieldIndex];

    boolean[] inputIsNull = structColumnVector.isNull;
    boolean[] outputIsNull = outV.isNull;

    outV.reset();

    if (structColumnVector.isRepeating) {
      if (structColumnVector.noNulls || !structColumnVector.isNull[0]) {
        outputIsNull[0] = false;
        outV.setElement(0, 0, fieldColumnVector);
      } else {
        outputIsNull[0] = true;
        outV.noNulls = false;
      }
      outV.isRepeating = true;
      return;
    }
    if (structColumnVector.noNulls) {
      if (batch.selectedInUse) {

        // CONSIDER: For large n, fill n or all of isNull array and use the tighter ELSE loop.

        if (!outV.noNulls) {
          for(int j = 0; j != n; j++) {
           final int i = sel[j];
           outputIsNull[i] = false;
           outV.setElement(i, i, fieldColumnVector);
         }
        } else {
          for(int j = 0; j != n; j++) {
            final int i = sel[j];
            outV.setElement(i, i, fieldColumnVector);
          }
        }
      } else {
        if (!outV.noNulls) {

          // Assume it is almost always a performance win to fill all of isNull so we can
          // safely reset noNulls.
          Arrays.fill(outputIsNull, false);
          outV.noNulls = true;
        }
        for(int i = 0; i != n; i++) {
          outV.setElement(i, i, fieldColumnVector);
        }
      }
    } else  /* there are NULLs in the structColumnVector */ {

      /*
       * Do careful maintenance of the outputColVector.noNulls flag.
       */

      if (batch.selectedInUse) {
        for(int j=0; j != n; j++) {
          int i = sel[j];
          if (!inputIsNull[i]) {
            outputIsNull[i] = false;
            outV.setElement(i, i, fieldColumnVector);
          } else {
            outputIsNull[i] = true;
            outV.noNulls = false;
          }
        }
      } else {
        for(int i = 0; i != n; i++) {
          if (!inputIsNull[i]) {
            outputIsNull[i] = false;
            outV.setElement(i, i, fieldColumnVector);
          } else {
            outputIsNull[i] = true;
            outV.noNulls = false;
          }
        }
      }
    }
  }
Vectorized instruction to get the field of Struct type with field name and put
the result in an output column.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFStructField.java