I am getting below error:
Failed to parse: could not instantiate '<pigUDF>' with arguments
'null' while using UDFContext for json parsing.
.
.
Caused by: java.io.EOFException: No content to map to Object due to
end of input
Of course, not getting error while parsing json without use of UDFContext.
Method written in this way:
private static final String JSON_FILE= "json_file";
private void loadJSONInUDFContext() throws JsonProcessingException, FileNotFoundException, IOException {
UDFContext udfContext = UDFContext.getUDFContext();
Properties properties =
udfContext.getUDFProperties([pigUDF.class);
List<TopicAndIndicator> list = JSONLoader.parseJSON();
properties.put(JSON_FILE, list);
}
I am not getting error while running on local, but getting while running on server.