/** * * {@inheritDoc} * @see org.apache.parquet.io.api.RecordMaterializer#getCurrentRecord() */ @Override public T getCurrentRecord() { try { if (missingRequiredFieldsInProjection) { List<TProtocol> fixedEvents = new ProtocolEventsAmender(rootEvents).amendMissingRequiredFields(thriftType); protocol.addAll(fixedEvents); } else { protocol.addAll(rootEvents); } rootEvents.clear(); return thriftReader.readOneRecord(protocol); } catch (TException e) { protocol.clear(); rootEvents.clear(); throw new RecordMaterializationException("Could not read thrift object from protocol", e); } }