title: Unable to use StructField with PySpark
body: <p>I'm running the PySpark shell and unable to create a dataframe. I've done </p>
  
  <pre><code>import pyspark
  from pyspark.sql.types import StructField
  from pyspark.sql.types import StructType
  </code></pre>
  
  <p>all without any errors returned.</p>
  
  <p>Then I tried running these commands:</p>
  
  <pre><code>schemaString = "name age"
  fields = [StructField(field_name, StringType(), True) for field_name in schemaString.split()]
  </code></pre>
  
  <p>And keep getting the error: ` name 'StructField' is not defined</p>
  
  <p>Basically, I'm following the Spark documentation here: <a href="https://spark.apache.org/docs/1.3.0/sql-programming-guide.html" rel="nofollow noreferrer">https://spark.apache.org/docs/1.3.0/sql-programming-guide.html</a></p>
  
  <p>Weird, if I remove the <code>for</code> loop and do this, it works: </p>
  
  <pre><code>fields = [StructField('field1', StringType(), True)]
  </code></pre>