private Schema getSchema(JobConf job, FileSplit split) throws AvroSerdeException, IOException {
    // Inside of a MR job, we can pull out the actual properties
    if(AvroSerdeUtils.insideMRJob(job)) {
      MapWork mapWork = Utilities.getMapWork(job);

      // Iterate over the Path -> Partition descriptions to find the partition
      // that matches our input split.
      for (Map.Entry<Path,PartitionDesc> pathsAndParts: mapWork.getPathToPartitionInfo().entrySet()){
        Path partitionPath = pathsAndParts.getKey();
        if(pathIsInPartition(split.getPath(), partitionPath)) {
          LOG.info("Matching partition {} with input split {}", partitionPath,
              split);

          Properties props = pathsAndParts.getValue().getProperties();
          if(props.containsKey(AvroTableProperties.SCHEMA_LITERAL.getPropName()) || props.containsKey(AvroTableProperties.SCHEMA_URL.getPropName())) {
            return AvroSerdeUtils.determineSchemaOrThrowException(job, props);
          }
          else {
            return null; // If it's not in this property, it won't be in any others
          }
        }
      }
      LOG.info("Unable to match filesplit {} with a partition.", split);
    }

    // In "select * from table" situations (non-MR), we can add things to the job
    // It's safe to add this to the job since it's not *actually* a mapred job.
    // Here the global state is confined to just this process.
    String s = job.get(AvroTableProperties.AVRO_SERDE_SCHEMA.getPropName());
    if (StringUtils.isNotBlank(s)) {
      LOG.info("Found the avro schema in the job");
      LOG.debug("Avro schema: {}", s);
      return AvroSerdeUtils.getSchemaFor(s);
    }
    // No more places to get the schema from. Give up.  May have to re-encode later.
    return null;
  }
Attempt to retrieve the reader schema.  We have a couple opportunities
to provide this, depending on whether or not we're just selecting data
or running with a MR job.
@return  Reader schema for the Avro object, or null if it has not been provided.
@throws AvroSerdeException
ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.java