-UDFContext() for a UDF
Raghu Angadi 2011-06-27, 21:16
UDF I am trying to implement:
- output schema is same as input schema.
- if (input == null)
return tuple matching the schema with NULL for each field.
else return input.
For this, the UDF needs to pass number for fields in input schema to
backend. LoadFunc and StoreFunc handle such a case through setting
properties in UDFContext.getUDFContext().getUDFProperties(class, *
But there does not seem to be any context signature for UDFs.
Is there a way implement such UDF?
Once option is to ask the user to provide number of fields as an argument to
UDF constructor, but that is pretty error prone and practical only in very
UDFContext seems to contain context only for storage.