On Tue, Apr 5, 2011 at 2:20 PM, Larry Ogrodnek <la...@bizo.com> wrote: > For some UDFs I'm working on now it feels like it would be handy to be > able to pass in parameters during construction. It's an integration > with an external reporting API... > > e.g. > > -- include last 30 days from april 4th > create temporary function orders_last_month as > 'com.example.OrderSearch("20110404", 30)' > > -- get orders for customer 11 > select order_last_month(11), ... > > > Obviously I can perform the same logic passing everything into the UDF: > > select orders_last_month("20110404", 30, 11), ... > > > but this doesn't feel as nice.. > > additionally, having the information available in the constructor > might give the UDF more information on how to perform caching, allow > it to do more complex initialization, etc. > > > Just wondering if this has ever been thought about, discussed, or > needed by anyone else.... > > thanks, > larry >
You can put that information inside the configuation or file system and access it from the UDF.