title: How to create Spark/Scala project in IntelliJ IDEA (fails to resolve dependencies in build.sbt)?
body: <p>I'm trying to build and run a Scala/Spark project in IntelliJ IDEA.</p>
  
  <p>I have added <code>org.apache.spark:spark-sql_2.11:2.0.0</code> in global libraries and my <code>build.sbt</code> looks like below.</p>
  
  <pre><code>name := "test"
  
  version := "1.0"
  
  scalaVersion := "2.11.8"
  
  libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.0.0"
  libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.0.0"
  </code></pre>
  
  <p>I still get an error that says</p>
  
  <blockquote>
    <p>unknown artifact. unable to resolve or indexed</p>
  </blockquote>
  
  <p>under <code>spark-sql</code>.</p>
  
  <p>When tried to build the project the error was</p>
  
  <blockquote>
    <p>Error:(19, 26) not found: type sqlContext, val sqlContext = new sqlContext(sc) </p>
  </blockquote>
  
  <p>I have no idea what the problem could be. How to create a Spark/Scala project in IntelliJ IDEA?</p>
  
  <p><strong>Update</strong>:
  Following the suggestions I updated the code to use <code>Spark Session</code>, but it still unable to read a csv file. What am I doing wrong here? Thank you!</p>
  
  <pre><code> val spark = SparkSession
  .builder()
  .appName("Spark example")
  .config("spark.some.config.option", "some value")
  .getOrCreate()
  
  import spark.implicits._
  
  val testdf = spark.read.csv("/Users/H/Desktop/S_CR_IP_H.dat")
  testdf.show()  //it doesn't show anything 
  //pdf.select("DATE_KEY").show()
  </code></pre>