private static VectorExpressionWriter genVectorExpressionWritableList(
      SettableListObjectInspector fieldObjInspector) throws HiveException {

    return new VectorExpressionWriterList() {
      private Object obj;
      private VectorExtractRow vectorExtractRow;
      private ListTypeInfo listTypeInfo;

      public VectorExpressionWriter init(SettableListObjectInspector objInspector) throws HiveException {
        super.init(objInspector);
        obj = initValue(null);
        vectorExtractRow = new VectorExtractRow();
        listTypeInfo = (ListTypeInfo)
            TypeInfoUtils.getTypeInfoFromTypeString(objInspector.getTypeName());
        return this;
      }

      @Override
      public Object initValue(Object ignored) {
        return ((SettableListObjectInspector) this.objectInspector).create(0);
      }

      @Override
      public Object writeValue(ColumnVector column, int row)
          throws HiveException {
        final ListColumnVector listColVector = (ListColumnVector) column;
        final SettableListObjectInspector listOI =
            (SettableListObjectInspector) this.objectInspector;
        final List value = (List) vectorExtractRow.extractRowColumn(listColVector,
            listTypeInfo, listOI, row);
        if (value == null) {
          return null;
        }

        listOI.resize(obj, value.size());
        for (int i = 0; i < value.size(); i++) {
          listOI.set(obj, i, value.get(i));
        }
        return obj;
      }

      @Override
      public Object setValue(Object list, ColumnVector column, int row)
          throws HiveException {
        if (list == null) {
          list = initValue(null);
        }

        final ListColumnVector listColVector = (ListColumnVector) column;
        final SettableListObjectInspector listOI =
            (SettableListObjectInspector) this.objectInspector;
        final List value = (List) vectorExtractRow.extractRowColumn(listColVector,
            listTypeInfo, listOI, row);
        if (value == null) {
          return null;
        }

        listOI.resize(list, value.size());
        for (int i = 0; i < value.size(); i++) {
          listOI.set(list, i, value.get(i));
        }
        return list;
      }

    }.init(fieldObjInspector);
  }
Compiles the appropriate vector expression writers based on a struct object
inspector.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java