title: how to query data from Pyspark sql context if key is not present in json fie , How to catch give sql analysis execption
body: <p>I am using Pyspark to transform JSON in a Dataframe. And I am successfully able to transform it. But the problem I am facing is there is a key which will be present in some JSON file and will not be present in another. When I flatten the JSON with Pyspark SQL context and the key is not present in some JSON file, it gives error in creating my Pyspark data frame, throwing SQL Analysis Exception. </p>
  
  <p>for example my sample JSON</p>
  
  <pre><code>{
      "_id" : ObjectId("5eba227a0bce34b401e7899a"),
      "origin" : "inbound",
      "converse" : "72412952",
      "Start" : "2020-04-20T06:12:20.89Z",
      "End" : "2020-04-20T06:12:53.919Z",
      "ConversationMos" : 4.88228940963745,
      "ConversationRFactor" : 92.4383773803711,
      "participantId" : "bbe4de4c-7b3e-49f1-8",
  }
  </code></pre>
  
  <p>The above JSON participant id will be available in some JSON and not in another JSON files </p>
  
  <p>My pysaprk code snippet:</p>
  
  <pre><code>fetchFile = sark.read.format(file_type)\
                  .option("inferSchema", "true")\
                  .option("header","true")\
                  .load(generated_FileLocation)
  
  fetch file.registerTempTable("CreateDataFrame")
  tempData = sqlContext.sql("select origin,converse,start,end,participantId from CreateDataFrame")
  </code></pre>
  
  <p>When, in some JSON file <code>participantId</code> is not present, an exception is coming. How to handle that kind of exception that if the key is not present so column  will contain null or any other ways to handle it</p>