private int getStructFieldIndex(ExprNodeFieldDesc exprNodeFieldDesc) throws HiveException {
    ExprNodeDesc structNodeDesc = exprNodeFieldDesc.getDesc();
    String fieldName = exprNodeFieldDesc.getFieldName();
    if (exprNodeFieldDesc.getIsList()) {
      throw new HiveException("Could not vectorize expression with a LIST type without an index");
    }
    StructTypeInfo structTypeInfo = (StructTypeInfo) structNodeDesc.getTypeInfo();
    int index = 0;
    boolean isFieldExist = false;
    for (String fn : structTypeInfo.getAllStructFieldNames()) {
      if (fieldName.equals(fn)) {
        isFieldExist = true;
        break;
      }
      index++;
    }
    if (isFieldExist) {
      return index;
    } else {
      throw new HiveException("Could not vectorize expression:" + exprNodeFieldDesc.toString()
          + ", the field " + fieldName + " doesn't exist.");
    }
  }
The field of Struct is stored in StructColumnVector.fields[index].
Check the StructTypeInfo.getAllStructFieldNames() and compare to the field name, get the index.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java