Home › Forums › kdb+ › Running user defined aggregation on partitioned tables › Re: Running user defined aggregation on partitioned tables
-
To my knowledge, the best way you can do is to fetch the data into memory and apply the custom aggregate function to the retrieved data, like the below
update percentile:getPercentile price from select sym, price from trade where date>=.z.d-7 // and other filters
Certain function like
sum
andprd
can reduce in a memory-effective way as they don’t need to keep the original values from each partition. Howevermed
or yourgetPercentile
function cannot.