title: Py4JError: An error accurred while calling .saveAsTable
body: <p>I am trying to train linear regression using spark. I have a loop in which I train the model 9 times, on the first pass the cycle processes and proceeds to the second model. at the moment:</p>
  <pre><code>df.write.mode('overwrite').saveAsTable('name_table')
  </code></pre>
  <p>python gives an error:</p>
  <p><code>Py4JError: An error occurred while calling o2254.saveAsTable</code></p>