title: Avro logicalType 'date' with default null value
body: <p>I need to add a 'null' default value to a logicalType: 'date' in my Avro schema. The current definition I have is like this:</p>
  
  <pre><code>{
   "type": "record",
   "namespace": "my.model.package",
   "name": "Person",
   "version": "1",
   "fields": [
      {"name":"birthday","type": { "type": "int", "logicalType": "date"}}
   ]
  }
  </code></pre>
  
  <p>When I populate 'birthday' field with a <code>org.joda.time.LocalDate</code> it does work but when I do leave it <code>null</code> I get the following exception:</p>
  
  <pre><code>org.apache.kafka.common.errors.SerializationException: Error serializing Avro message
  Caused by: java.lang.NullPointerException: null of int of my.model.package.Person
  at org.apache.avro.generic.GenericDatumWriter.npe(GenericDatumWriter.java:145)
  at org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:139)
  at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:75)
  at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:62)
  at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:92)
  at io.confluent.kafka.serializers.KafkaAvroSerializer.serialize(KafkaAvroSerializer.java:53)
  at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:459)
  at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:436)
  ...
  </code></pre>
  
  <p>I tried many ways to configure this 'logicalType' as nullable but could not get it working. How can I configure this field to be nullable?</p>