Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1997

Avro Field.defaultVal broken for Fixed fields.

    XMLWordPrintableJSON

Details

    Description

      here is a unit test to reproduce the issue:

      package org.apache.avro;
      
      import java.nio.ByteBuffer;
      import org.junit.Assert;
      import org.junit.Test;
      
      public class TestFixed {
      
      
        @Test
        public void testFixedDefaultValueDrop() {
          Schema md5 = SchemaBuilder.builder().fixed("MD5").size(16);
          Schema frec = SchemaBuilder.builder().record("test")
                  .fields().name("hash").type(md5).withDefault(ByteBuffer.wrap(new byte[16])).endRecord();
          Schema.Field field = frec.getField("hash");
          Assert.assertNotNull(field.defaultVal());
        }
      
      }
      

      Attachments

        Issue Links

          Activity

            People

              zolyfarkas Zoltan Farkas
              zolyfarkas Zoltan Farkas
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: