MCPcopy Create free account
hub / github.com/apache/pig / StreamingUDF

Method StreamingUDF

src/org/apache/pig/impl/builtin/StreamingUDF.java:112–140  ·  view source on GitHub ↗
(String language,
                        String filePath, String funcName,
                        String outputSchemaString, String schemaLineNumber,
                        String execType, String isIllustrate)

Source from the content-addressed store, hash-verified

110 public static final String TURN_ON_OUTPUT_CAPTURING = "TURN_ON_OUTPUT_CAPTURING";
111
112 public StreamingUDF(String language,
113 String filePath, String funcName,
114 String outputSchemaString, String schemaLineNumber,
115 String execType, String isIllustrate)
116 throws StreamingUDFOutputSchemaException, ExecException {
117 this.language = language;
118 this.filePath = filePath;
119 this.funcName = funcName;
120 try {
121 this.schema = Utils.getSchemaFromString(outputSchemaString);
122 //ExecTypeProvider.fromString doesn't seem to load the ExecTypes in
123 //mapreduce mode so we'll try to figure out the exec type ourselves.
124 if (execType.equals("local")) {
125 this.execType = ExecType.LOCAL;
126 } else if (execType.equals("mapreduce")) {
127 this.execType = ExecType.MAPREDUCE;
128 } else {
129 //Not sure what exec type - try to get it from the string.
130 this.execType = ExecTypeProvider.fromString(execType);
131 }
132 } catch (ParserException pe) {
133 throw new StreamingUDFOutputSchemaException(pe.getMessage(), Integer.valueOf(schemaLineNumber));
134 } catch (IOException ioe) {
135 String errorMessage = "Invalid exectype passed to StreamingUDF. Should be local or mapreduce";
136 log.error(errorMessage, ioe);
137 throw new ExecException(errorMessage, ioe);
138 }
139 this.isIllustrate = isIllustrate;
140 }
141
142 @Override
143 public Object exec(Tuple input) throws IOException {

Callers

nothing calls this directly

Calls 5

getSchemaFromStringMethod · 0.95
fromStringMethod · 0.95
equalsMethod · 0.45
getMessageMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected