@Test
  public void primitiveSchemaEvolution() throws Exception {
    Schema fileSchema = AvroSerdeUtils.getSchemaFor(
     "{\n"
         + "  \"type\": \"record\",\n"
         + "  \"name\": \"r1\",\n"
         + "  \"fields\": [\n"
         + "    {\n"
         + "      \"name\": \"int_field\",\n"
         + "      \"type\": \"int\"\n"
         + "    }\n"
         + "  ]\n"
         + "}"
    );
    Schema readerSchema = AvroSerdeUtils.getSchemaFor(
       "{\n"
           + "  \"type\": \"record\",\n"
           + "  \"name\": \"r1\",\n"
           + "  \"fields\": [\n"
           + "    {\n"
           + "      \"name\": \"int_field\",\n"
           + "      \"type\": \"int\"\n"
           + "    },\n"
           + "    {\n"
           + "      \"name\": \"dec_field\",\n"
           + "      \"type\": [\n"
           + "        \"null\",\n"
           + "        {\n"
           + "          \"type\": \"bytes\",\n"
           + "          \"logicalType\": \"decimal\",\n"
           + "          \"precision\": 5,\n"
           + "          \"scale\": 4\n"
           + "        }\n"
           + "      ],\n"
           + "      \"default\": null\n"
           + "    }\n"
           + "  ]\n"
           + "}"
    );
    GenericData.Record record = new GenericData.Record(fileSchema);

    record.put("int_field", 1);
    assertTrue(GENERIC_DATA.validate(fileSchema, record));
    AvroGenericRecordWritable garw = Utils.serializeAndDeserializeRecord(record);
    AvroObjectInspectorGenerator aoig = new AvroObjectInspectorGenerator(readerSchema);

    AvroDeserializer de = new AvroDeserializer();
    List<Object> row = (List<Object>) de.deserialize(aoig.getColumnNames(), aoig.getColumnTypes(), garw, readerSchema);
    Assert.assertEquals(1, row.get(0));
    Assert.assertNull(row.get(1));
  }
Test whether Avro timestamps can be deserialized according to new behavior (storage in UTC but
LocalDateTime semantics as timestamps are converted back to the writer time zone) as well as
old behavior (Instant semantics).
serde/src/test/org/apache/hadoop/hive/serde2/avro/TestAvroDeserializer.java