title: sql query results to pandas df within databricks notebook
body: <p>I have a sql query results that I would like to convert into a pandas df within the databricks notebook. The query is pulling data from the dbx tables, if this is important to know.</p>
  <p>My query looks something like this:</p>
  <pre><code>With cte1 as (
     SELECT col1, col2 FROM Table1),
  cte2 as(
     SELECT col10, col12 FROM Table2)
  
  SELECT * FROM cte1 JOIN cte2 on col1=col10
  
  </code></pre>
  <p>I got the results that I am looking for, then I want to convert this into a pandas df while within databricks.
  The last one I tried is using the <code>from pyspark.sql import SQLContext</code> after my last googling, though there is nothing specific to my intention that I can find, but it throws a sql error.</p>
  <pre><code>from pyspark.sql import SQLContext
  sqlContext = SQLContext(sc)
  
  df = sqlContext.sql(&quot;&quot;&quot;
  With cte1 as (
     SELECT col1, col2 FROM Table1),
  cte2 as(
     SELECT col10, col12 FROM Table2)
  
  SELECT * FROM cte1 JOIN cte2 on col1=col10
  &quot;&quot;&quot;
  )
  </code></pre>
  <p>Is there a way to convert the sql query results into a pandas df within databricks notebook?</p>