title: PySpark equivalent of pandas read_sql_query
body: <p>I'm trying to switch from pandas to pyspark and usually when I did my analysis I used <code>pd.read_sql_query</code> to read the data needed for the analysis from a redshift database.</p>
  <p>Example:</p>
  <pre><code>query = '''
  SELECT id, SUM(value)
  FROM table
  GROUP BY id
  '''
  
  df = pd.read_sql_query(query, engine)
  </code></pre>
  <p>Is there any equivalent function in PySpark? Something that receives a query and a SQLAlchemy engine and returns the result of the query? If not, what is the best way to get a result of a SQL query in pyspark?</p>
  <p>I tried to find something in <code>pyspark.SQLContext</code> but didn't find anything useful.</p>