code: private MessageType getPartialReadSchema(InitContext context)
    {
      MessageType fullSchema = context.getFileSchema();
  
      String name = fullSchema.getName();
  
      HadoopDruidIndexerConfig config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration());
      ParseSpec parseSpec = config.getParser().getParseSpec();
  
      // this is kind of lame, maybe we can still trim what we read if we
      // parse the flatten spec and determine it isn't auto discovering props?
      if (parseSpec instanceof ParquetParseSpec) {
        if (((ParquetParseSpec) parseSpec).getFlattenSpec() != null) {
          return fullSchema;
        }
      }
  
      String tsField = parseSpec.getTimestampSpec().getTimestampColumn();
  
      List<DimensionSchema> dimensionSchema = parseSpec.getDimensionsSpec().getDimensions();
      Set<String> dimensions = new HashSet<>();
      for (DimensionSchema dim : dimensionSchema) {
        dimensions.add(dim.getName());
      }
  
      Set<String> metricsFields = new HashSet<>();
      for (AggregatorFactory agg : config.getSchema().getDataSchema().getAggregators()) {
        metricsFields.addAll(agg.requiredFields());
      }
  
      List<Type> partialFields = new ArrayList<>();
  
      for (Type type : fullSchema.getFields()) {
        if (tsField.equals(type.getName())
            || metricsFields.contains(type.getName())
            || dimensions.size() > 0 && dimensions.contains(type.getName())
            || dimensions.size() == 0) {
          partialFields.add(type);
        }
      }
  
      return new MessageType(name, partialFields);
    }
docs: Select the columns from the parquet schema that are used in the schema of the ingestion job
  
  @param context The context of the file to be read
  
  @return the partial schema that only contains the columns that are being used in the schema