title: Why does Spark fail with "value write is not a member of org.apache.spark.sql.DataFrameReader [error]"?
body: <p>I have two almost identical write into db . scala statement ,however one trowing me an error the other not and i don't understand how to fix it ? any ideas ? </p>
  
  <p>this statement is working </p>
  
  <pre><code>df_pm_visits_by_site_trn.write.format("jdbc").option("url", db_url_2).option("dbtable", "pm_visits_by_site_trn").option("user", db_user).option("password", db_pwd).option("truncate","true").mode("overwrite").save()
  </code></pre>
  
  <p>this one doesn't work and throwing me compiling error</p>
  
  <pre><code>df_trsnss .write.format("jdbc").option("url", db_url_2).option("dbtable", "df_trsnss")               .option("user", db_user).option("password", db_pwd).option("truncate","true").mode("overwrite").save()
  </code></pre>
  
  <blockquote>
    <p>_dev.scala:464: value write is not a member of org.apache.spark.sql.DataFrameReader [error]
    df_trsnss.write.format("jdbc").option("url",
    db_url_2).option("dbtable", "trsnss").option("user",
    db_user).option("password",
    db_pwd).option("truncate","true").mode("overwrite").save()</p>
  </blockquote>
  
  <p>if i delete my second write statement or just simply comment it out whole code is compiling with no errors.</p>