protected static void setRowFromStruct(Row row, Object structVal, StructObjectInspector soi) {
    Schema structSchema = row.getSchema();
    // Add struct field data to the Row
    List<? extends StructField> structFields = soi.getAllStructFieldRefs();
    for (int idx = 0; idx < structFields.size(); ++idx) {
      StructField structField = structFields.get(idx);

      Object convertedFieldValue = convertValue(
          soi.getStructFieldData(structVal, structField),
          structField.getFieldObjectInspector());
      row.setValue(idx, convertedFieldValue);
    }
  }
Row-based record reader for LLAP.
llap-client/src/java/org/apache/hadoop/hive/llap/LlapRowRecordReader.java