title: kafka-connect-elasticsearch: When using "write.method" as upsert, is it possible to use same AVRO object on kafka topic to send partial document?
body: <p>I am trying to use "write.method" upsert for Elasticsearch (ES) kafka connector. From my kafka streams application I am writing my document that I want to upsert, on a kafka topic that ES connector is configured to read from. I am using avro objects as kafka values on this topic. My document's AVRO definition looks like below:</p>
  
  <pre><code>{
    "type": "record",
    "name": "Document",
    "fields": [
      {
        "name": "id",
        "type": ["null", "string"],
      },
      {
        "name": "name",
        "type": ["null", "string"]
      },
      {
        "name": "address",
        "type": ["null", "string"]
      }
    ]
  }
  </code></pre>
  
  <p>The document contains only id and name at times and other times it contains just address. id and name get overwritten when I just send address and vice versa. I have set <code>behavior.on.null.values</code> to <code>ignore</code> hoping that ES connector would ignore the null id and name values, but that doesn't work as expected. </p>
  
  <p>Although when I use two different AVRO objects on my kafka topic, first one containing only id and name, the other one containing only address, upsert mode behavior is as expected. But for the same kafka topic to allow multiple AVRO object definitions, I need to set compatibility mode of the topic to NONE, which isn't ideal. </p>
  
  <p>What's the right way to solve the issue at hand?</p>