title: Hive percentile group by two variables
body: <p>I have a Hive table where I want to find the 10th percentile, median, and 90th percentile of a value at a location/weekday basis.  A mockup of the table is below. How can I write a query so that the output table columns are location, weekday, 10th percentile, median, and 90th percentile of MyValue?  (Assume that the actual table has a lot of different Locations and multiple entries per location/weekday combination)</p>
  
  <p>I have tried:</p>
  
  <pre><code>create table myschema.my_output_table as
  select location, weekday,
  percentile(MyValue,0.1) over location,weekday as Weekday10pctile
  from myschema.my_input_table
  </code></pre>
  
  <p>Sample Data:</p>
  
  <pre><code>Location      Weekday       MyValue
  Location_A    Monday        2.844958857
  Location_A    Monday        1.22455235
  Location_A    Monday        2.415189236
  Location_A    Monday        2.162431558
  Location_A    Tuesday       2.200264375
  Location_A    Tuesday       1.218341845
  Location_A    Tuesday       1.668882003
  Location_A    Tuesday       0.077343061
  Location_A    Wednesday     2.977162672
  Location_A    Wednesday     2.059018125
  Location_A    Wednesday     2.309147998
  Location_A    Wednesday     1.241566476
  </code></pre>