title: PySpark, importing schema through JSON file
body: <p><code>tbschema.json</code> looks like this: </p>
  
  <pre><code>[{"TICKET":"integer","TRANFERRED":"string","ACCOUNT":"STRING"}]
  </code></pre>
  
  <p>I load it using following code</p>
  
  <pre><code>&gt;&gt;&gt; df2 = sqlContext.jsonFile("tbschema.json")
  &gt;&gt;&gt; f2.schema
  StructType(List(StructField(ACCOUNT,StringType,true),
      StructField(TICKET,StringType,true),StructField(TRANFERRED,StringType,true)))
  &gt;&gt;&gt; df2.printSchema()
  root
   |-- ACCOUNT: string (nullable = true)
   |-- TICKET: string (nullable = true)
   |-- TRANFERRED: string (nullable = true)
  </code></pre>
  
  <ol>
  <li><p>Why does the schema elements gets sorted, when I want the elements in the same order as they appear in the JSON.</p></li>
  <li><p>The data type integer has been converted into StringType after the JSON has been derived, how do I retain the datatype.</p></li>
  </ol>