title: Getting pyspark.sql.utils.ParseException: mismatched input '(' expecting {<EOF>
body: <p>I am trying to rank the  column 'Product' based on the revenue from below data frame- salesDF</p>
  <pre><code>salesDF=
  +-------------+-------+---------+----------+-------+
  |transactionID|Product| category|produtType|Revenue|
  +-------------+-------+---------+----------+-------+
  |          105| Lenova|   laptop|      high|  40000|
  |          111| Lenova|   tablet|    medium|  20000|
  |          103|   dell|   laptop|     medum|  25000|
  |          107| iphone|cellPhone|     small|  70000|
  |          113| lenovo|cellPhone|    medium|   8000|
  |          108|     mi|cellPhone|     medum|  10000|
  </code></pre>
  <p>Now below iam using spark sql to rank each Product based on the Revenue</p>
  <pre><code>rankTheRevenue= salesDF.createTempView(&quot;Ranking_DF&quot;)
  rankProduct= session.sql(&quot;select Product, Revenue, rank() over(partion by Product order by Revenue) as Rank_revenue from Ranking_DF&quot;)
  rankProduct.show()
  </code></pre>
  <h2>But iam getting following error</h2>
  <pre><code>pyspark.sql.utils.ParseException: 
  mismatched input '(' expecting {&lt;EOF&gt;, ',', 'CLUSTER', 'DISTRIBUTE', 'EXCEPT', 'FROM', 'GROUP', 'HAVING', 'INTERSECT', 'LATERAL', 'LIMIT', 'ORDER', 'MINUS', 'SORT', 'UNION', 'WHERE', 'WINDOW', '-'}(line 1, pos 36)
  </code></pre>
  <p>Appreciate if anyone can help me to resolve this kind of issue</p>
  <p>Thanks</p>