title: How to specify timestamp in avro schema
body: <p>I am trying to convert this value <code>1520200800049</code> in <code>Avro</code>. This is the specification of the field in my schema which is a <code>union</code> schema by the way:</p>
  
  <pre><code>{
   "name" : "TimestampField"
   "type" : ["null",{
      "type":"long",
      "logicalType":"timestamp-millis"
   }]
  }
  </code></pre>
  
  <p>This is the error that I get:</p>
  
  <pre><code>Caused by: org.apache.avro.UnresolvedUnionException: Not in union ["null",{"type":"long","logicalType":"timestamp-millis"}]: 1520200800049 
      at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:740) 
      at org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:205) 
      at org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:123) 
      at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:75) 
      at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:166) 
      at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:156) 
      at org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:118) 
      at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:75) 
      at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:62) 
      at org.apache.avro.file.DataFileWriter.append(DataFileWriter.java:302)
  </code></pre>
  
  <p>When I change the schema to:</p>
  
  <pre><code>{
   "name" : "TimestampField"
   "type" : ["null" , "long"]
  }
  </code></pre>
  
  <p>It works. But this is not the point. I want to convert it to <code>timestamp</code> for <code>Hive</code> purposes.</p>