title: Why does IntelliJ IDEA say "Cannot resolve symbol spark" for spark.sparkContext.textFile?
body: <p>The follow is my pom.xml</p>
  
  <pre><code>&lt;groupId&gt;recommend&lt;/groupId&gt;
  &lt;artifactId&gt;MovieLensALS&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  
  &lt;properties&gt;
      &lt;spark.version&gt;2.1.1&lt;/spark.version&gt;
      &lt;scala.version&gt;2.11&lt;/scala.version&gt;
  &lt;/properties&gt;
  
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
          &lt;artifactId&gt;spark-core_${scala.version}&lt;/artifactId&gt;
          &lt;version&gt;${spark.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
          &lt;artifactId&gt;spark-streaming_${scala.version}&lt;/artifactId&gt;
          &lt;version&gt;${spark.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
          &lt;artifactId&gt;spark-sql_${scala.version}&lt;/artifactId&gt;
          &lt;version&gt;${spark.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
          &lt;artifactId&gt;spark-hive_${scala.version}&lt;/artifactId&gt;
          &lt;version&gt;${spark.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
          &lt;artifactId&gt;spark-mllib_${scala.version}&lt;/artifactId&gt;
          &lt;version&gt;${spark.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
              &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.15.2&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;goal&gt;testCompile&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.6.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.19&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;skip&gt;true&lt;/skip&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/WCHdg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WCHdg.png" alt="wrong code hint"></a></p>
  
  <p>I want use Spark Sql int  Intellij but some thing is wrong. My Spark version is the latest 2.1.1 and scala version is 2.11.*
  Who can tell me what is problem or tell me how to code about spark sql(2.1.1) </p>