title: Why does insertInto fail when working with tables in non-default database?
body: <p>I'm using Spark 1.4.0 (PySpark). I have a DataFrame loaded from Hive table using this query:</p>
  
  <pre><code>sqlContext = HiveContext(sc)
  table1_contents = sqlContext.sql("SELECT * FROM my_db.table1")
  </code></pre>
  
  <p>When I attempt to insert data from <code>table1_contents</code> after some transformations, into table2 using DataFrameWriter#insertInto function:</p>
  
  <pre><code>sqlContext.createDataFrame(transformed_data_from_table1).write.insertInto('my_db.table2')
  </code></pre>
  
  <p>I encounter this error:</p>
  
  <pre><code>py4j.protocol.Py4JJavaError: An error occurred while calling o364.insertInto.
  : org.apache.spark.sql.AnalysisException: no such table my_db.table2;
  </code></pre>
  
  <p>I know my table is existing because when I type:</p>
  
  <pre><code>print sqlContext.tableNames('my_db')
  </code></pre>
  
  <p>table1 and table2 are displayed. Can anyone help about this issue?</p>