parquet-pig/src/main/java/org/apache/parquet/pig/PigSchemaConverter.java
public MessageType filter(MessageType schemaToFilter, Schema requestedPigSchema, RequiredFieldList requiredFieldList) {
    try {
      if (LOG.isDebugEnabled()) LOG.debug("filtering schema:\n" + schemaToFilter + "\nwith requested pig schema:\n " + requestedPigSchema);
      List<Type> result = columnAccess.filterTupleSchema(schemaToFilter, requestedPigSchema, requiredFieldList);
      if (LOG.isDebugEnabled()) LOG.debug("schema:\n" + schemaToFilter + "\nfiltered to:\n" + result);
      return new MessageType(schemaToFilter.getName(), result);
    } catch (RuntimeException e) {
      throw new RuntimeException("can't filter " + schemaToFilter + " with " + requestedPigSchema, e);
    }
  }
public MessageType filter(MessageType schemaToFilter, Schema requestedPigSchema, RequiredFieldList requiredFieldList) {
    try {
      if (LOG.isDebugEnabled()) LOG.debug("filtering schema:\n" + schemaToFilter + "\nwith requested pig schema:\n " + requestedPigSchema);
      List<Type> result = columnAccess.filterTupleSchema(schemaToFilter, requestedPigSchema, requiredFieldList);
      if (LOG.isDebugEnabled()) LOG.debug("schema:\n" + schemaToFilter + "\nfiltered to:\n" + result);
      return new MessageType(schemaToFilter.getName(), result);
    } catch (RuntimeException e) {
      throw new RuntimeException("can't filter " + schemaToFilter + " with " + requestedPigSchema, e);
    }
  }
public MessageType filter ( MessageType schemaToFilter , Schema requestedPigSchema , RequiredFieldList requiredFieldList ) { try { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "filtering schema:\n" + schemaToFilter + "\nwith requested pig schema:\n " + requestedPigSchema ) ; List < Type > result = columnAccess . filterTupleSchema ( schemaToFilter , requestedPigSchema , requiredFieldList ) ; if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "schema:\n" + schemaToFilter + "\nfiltered to:\n" + result ) ; return new MessageType ( schemaToFilter . getName ( ) , result ) ; } catch ( RuntimeException e ) { throw new RuntimeException ( "can't filter " + schemaToFilter + " with " + requestedPigSchema , e ) ; } }
filters a Parquet schema based on a pig schema for projection
@param schemaToFilter the schema to be filter
@param requestedPigSchema the pig schema to filter it with
@param requiredFieldList projected required fields
@return the resulting filtered schema
filters a Parquet schema based on a pig schema for projection