private static Record convert(Types.StructType struct, HiveRow row) {
    if (row == null) {
      return null;
    }

    Record record = GenericRecord.create(struct);
    List<Types.NestedField> fields = struct.fields();
    for (int i = 0; i < fields.size(); i += 1) {
      Types.NestedField field = fields.get(i);

      Type fieldType = field.type();

      switch (fieldType.typeId()) {
        case STRUCT:
          record.set(i, convert(fieldType.asStructType(), row.get(i)));
          break;
        case LIST:
          record.set(i, convert(fieldType.asListType(), row.get(i)));
          break;
        case MAP:
          record.set(i, convert(fieldType.asMapType(), row.get(i)));
          break;
        default:
          record.set(i, convert(fieldType, row.get(i)));
      }
    }
    return record;
  }
Converts from HiveRow to Iceberg's internal data representation format
aka from POJOs used by Hive to hold record data into those of Iceberg
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/vector/HiveValueConverter.java