public static Schema getSchemaFor(InputStream stream) {
    Schema schema;
    try {
      schema = getSchemaParser().parse(stream);
    } catch (IOException e) {
      throw new RuntimeException("Failed to parse Avro schema", e);
    }
    return schema;
  }
Determine if we're being executed from within an MR job or as part
of a select * statement.  The signals for this varies between Hive versions.
@param job that contains things that are or are not set in a job
@return Are we in a job or not?
serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerdeUtils.java