title: missing BY at '(' near 'ORDER' in expression specification
body: <p>I get this error:</p>
  
  <blockquote>
    <p>u"line 2:34 missing BY at '(' near 'ORDER' in expression
    specification\nline 2:41 mismatched input 'BY' expecting ) near
    'ORDER' in expression specification;"</p>
  </blockquote>
  
  <p>when I run:</p>
  
  <pre><code>customer_cutoff3=sqlContext.sql("""
  select category,
  PERCENTILE_DISC(0.4) WITHIN GROUP (ORDER BY ty_spend) OVER (PARTITION BY category ) as low_spend_cutoff
  from customer_cutoff2
  where ty_visits&gt;0
  group by category
  """).toPandas()
  </code></pre>
  
  <p>Can anybody help me please?</p>