title: Repartition in Spark - SQL API
body: <p>We use the <strong>SQL API</strong> of Spark to execute queries on <code>Hive</code> tables on the cluster. How can I perform a <code>REPARTITION</code> on a column in my query in <strong>SQL-API</strong> ?. Please note that we do not use the Dataframe API but instead we use the SQL API (for e.g <code>SELECT * from table WHERE col = 1</code>).</p>
  <p>I understand that PySpark-SQL offers a function for the same in the <code>Dataframe API</code>.</p>
  <p>However, I want to know the syntax to specify a <code>REPARTITION</code> (on a specific column) in a SQL query via the <strong>SQL-API</strong> (thru a SELECT statement).</p>
  <p>Consider the following query :</p>
  <pre><code>select a.x, b.y
  from a
  JOIN b
  on a.id = b.id
  </code></pre>
  <p>Any help is appreciated.</p>
  <p>We use Spark 2.4</p>
  <p>Thanks</p>