title: AVRO schema evolution, default value for record type
body: <p>I'm trying to update our avro schema in order to add data.</p>
  
  <p>I encounter a problem when I try to read <strong>old</strong> data with the new schema</p>
  
  <p>data written using new schema have no issue.</p>
  
  <p>current schema: </p>
  
  <pre><code>{
      "type": "record",
      "name": "topLevelRecord",
      "fields": [
          {
              "name": "sub_record1",
              "type": [
                  {
                      "type": "record",
                      "name": "sub_record1",
                      "fields": [...]
                  }
              ]
          },
          {
              "name": "sub_record2",
              "type": [
                  {
                      "type": "record",
                      "name": "sub_record2",
                      "fields": [...]
                  }
              ]
          },
          {...}
      ]
  }
  </code></pre>
  
  <p>my goal is to add a new sub record <code>sub_record3</code>
  with the following schema:</p>
  
  <pre><code>{
        "name": "sub_record3",
        "type": [
          {
            "type": "record",
            "name": "sub_record3",
            "fields": [
              {
                "name": "field1",
                "default": null,
                "type": [
                  "null",
                  "string"
                ]
              },
              {
                "name": "field2",
                "default": null,
                "type": [
                  "null",
                  "string"
                ]
              }]
          }]
      }
  </code></pre>
  
  <p>my problem is when I try to add a default value for <code>sub_record3</code>.</p>
  
  <p>i tried the following :
  <code>default = {}</code>,
  <code>default = {"sub_record3":{}}</code>,
  <code>default = {"sub_record3":{"field1":null, "field2":null}}</code>,
  <code>default = {"sub_record3":{"field1":"", "field2":""}}</code>,
  <code>default = {"field1":null, "field2":null}</code></p>
  
  <p>but neither of those worked.</p>
  
  <p>currently we use a workaround based on addind null to <code>sub_record3</code> types and use it as default value but when reading data via hive it displays <code>NULL</code>.</p>
  
  <p>the goal is to have <code>{"field1":null, "field2":null}</code> returned as value for the sub_record3 field when sub_record3 is not present in data.</p>