//predecessors haven't been setup, return null
return null;
}
}
Schema inputSchema = new Schema();
List<ExpressionOperator> args = getArguments();
for(ExpressionOperator op: args) {
if (!DataType.isUsableType(op.getType())) {
mFieldSchema = null;
mIsFieldSchemaComputed = false;
int errCode = 1014;
String msg = "Problem with input: " + op + " of User-defined function: " + this ;
throw new FrontendException(msg, errCode, PigException.INPUT, false, null) ;
}
inputSchema.add(op.getFieldSchema());
}
EvalFunc<?> ef = (EvalFunc<?>) PigContext.instantiateFuncFromSpec(mFuncSpec);
Schema udfSchema = ef.outputSchema(inputSchema);
byte returnType = DataType.findType(ef.getReturnType());
if (null != udfSchema) {
Schema.FieldSchema fs;
// try {
if(udfSchema.size() == 0) {
fs = new Schema.FieldSchema(null, null, returnType);
} else if(udfSchema.size() == 1) {
fs = new Schema.FieldSchema(udfSchema.getField(0));
} else {
fs = new Schema.FieldSchema(null, udfSchema, DataType.TUPLE);
}
// } catch (ParseException pe) {
// throw new FrontendException(pe.getMessage());