title: Spark JSON Schema for dynamic key fields?
body: <p>I receive JSON data from kafka with <code>from_json()</code> method. It expects schema from me. My JSON structure like this;</p>
  
  <pre><code>{
      "Items": {
          "key1": [
              {
                  "id": "",
                  "name": "",
                  "val": ""
              }
          ],
          "key2": [
              {
                  "id": "",
                  "name": "",
                  "val": ""
              }
          ],
          "key3": [
              {
                  "id": "",
                  "name": "",
                  "val": ""
              }
          ]
      }
  }
  </code></pre>
  
  <p>In this state; <code>key1, key2, key3</code> fields are unknown. So, they are <code>dynamic</code>. These fields name may be <code>"abc", "def"</code> etc.. How can I define json schema for this JSON in Spark Structured Streaming?</p>
  
  <p><strong>EDIT:</strong>
  For example another json;</p>
  
  <pre><code>{
          "Items": {
              "stack": [
                  {
                      "id": "",
                      "name": "",
                      "val": ""
                  }
              ],
              "over": [
                  {
                      "id": "",
                      "name": "",
                      "val": ""
                  }
              ],
              "flow": [
                  {
                      "id": "",
                      "name": "",
                      "val": ""
                  }
              ]
          }
      }
  </code></pre>