Skip to content

Instantly share code, notes, and snippets.

@viksingh
Forked from SriniBlog/getInstanceUDF.java
Created February 9, 2018 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viksingh/c33574849b1e29de20ef61ba5530f986 to your computer and use it in GitHub Desktop.
Save viksingh/c33574849b1e29de20ef61ba5530f986 to your computer and use it in GitHub Desktop.
This is a psedu code to show how to get the instance of the trace, dynamic configuration etc. inside the UDF
public String getInstanceUDF(Container container) throws StreamTransformationException{
GlobalContainer globalContainer;
MappingTrace trace;
String headerField;
java.util.Map map;
trace = container.getTrace();
globalContainer = container.getGlobalContainer();
map = globalContainer.getTransformationParameters();
headerField = (String) map.get( StreamTransformationConstants.INTERFACE_NAMESPACE );
trace.addInfo("INTERFACE_NAMESPACE:" + headerField);
//Add the rest of the code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment