title: Why is "error: not found: value StructType" at sql schema create?
body: <p>I have the CDH5 version 1.0.0 of Spark installed on CentOS 6.2 and running without error.</p>
  
  <p>When trying to run some Spark SQL I encounter an error. I start my Spark shell fine ... </p>
  
  <pre><code>spark-shell --master spark://mysparkserver:7077
  </code></pre>
  
  <p>then I run one of the example Scala scripts from the programming guide at <a href="https://spark.apache.org/docs/latest/sql-programming-guide.html" rel="nofollow">Spark SQL Programming Guide</a>.</p>
  
  <pre><code>scala&gt; val sqlContext = new org.apache.spark.sql.SQLContext(sc)
  
  scala&gt; val vehicle = sc.textFile("/tmp/scala.csv")
  
  scala&gt; val schemaString = "year manufacturer model class engine cylinders fuel consumption clkm hlkm cmpg hmpg co2lyr co2gkm"
  
  scala&gt; import org.apache.spark.sql._
  
  scala &gt; val schema = 
  StructType
  ( 
  schemaString.split(" ").map(fieldName =&gt; 
      StructField(fieldName, StringType, true))
  )
  </code></pre>
  
  <p>But the import statement doesn't seem to have worked? Because the last line gives an error that </p>
  
  <pre><code>scala&gt; StructType
  &lt;console&gt;:14: error: not found: value StructType
                StructType
                ^
  </code></pre>
  
  <p>I do know that <code>StructType</code> is <code>org.apache.spark.sql.api.java.StructType</code>. And if I replace <code>StructType</code> in the schema line with the full name the error changes.</p>
  
  <p>Has anyone else encountered this error ? Is there an extra step required that I am missing? </p>