When you attempt to group by function using the query() function, it results in an NullPointerException.
Using the example webapp loaded with the hd.xml file in exampledocs, you can recreate by issuing the following query:
This appears to be due to a small bug in the following file:
The variable context is always null because it's scope is local to this function, but it gets passed on to another function later.
The patch is simply removing the Map qualifier from the instantiation.