title: Scala Cannot resolve symbol AnalysisException
body: <p>Scala newbie here. I am trying to catch some exceptions while reading files from S3 using spark and want my code to do nothing if <code>Path does not exist</code> exception occurs. For that I have a code like the following:</p>
  <pre><code>import org.apache.spark.sql.{Row, SQLContext, SparkSession, AnalysisException}
  
  var partnerData: org.apache.spark.sql.DataFrame = null
  if (fileType == &quot;csv&quot;){
    try{
      partnerData = spark.read
        .format(&quot;csv&quot;)
        .schema(inputSchema)
        .load(inputPath)
    } catch (AnalysisException e) {
  
    }
  } else {
    partnerData = spark.read
      .format(&quot;parquet&quot;)
      .load(inputPath)
  }
  </code></pre>
  <p>Although I have imported the <code>AnalysisException</code>, I keep seeing this message:</p>
  <blockquote>
  <p>Cannot resolve symbol AnalysisException</p>
  </blockquote>
  <p>Anything that I'm missing here? I am planning to detect the exception type first and then decide what to do next based on message text. I'd be grateful if you could point me to the right direction in case this doesn't make any sense as I've read multiple threads and haven't been able to find a better solution. This is much easier to do in python though.</p>