title: Pyspark get Schema from JSON file
body: <p>I am trying to get <code>Pyspark</code> schema from a JSON file but when I am creating the schema using the variable in the Python code, I am able to see the variable type of <code>&lt;class 'pyspark.sql.types.StructType'&gt;</code> but when I am trying to get through JSON file it's showing type of <code>unicode</code>.</p>
  
  <p>Is there any way to get <code>pyspark</code> schema through JSON file?</p>
  
  <p><strong>JSON file Content:</strong> </p>
  
  <pre><code>{                                                                                                                                                                                                
  "tediasessionclose_schema" : "StructType([ StructField('@timestamp', StringType()), StructField('message' , StructType([ StructField('componentAddress', StringType()), StructField('values', StructType([ StructField('confNum', StringType()), StructField('day', IntegerType())])"                                                                                                                                                         
  }
  </code></pre>
  
  <p><strong>Pyspark Code:</strong> </p>
  
  <pre><code>df = sc.read.json(hdfs_path, schema = jsonfile['tediasessionclose_schema'])
  </code></pre>