@InterfaceAudience.Public @InterfaceStability.Unstable @Documented @Retention(value=RUNTIME) public @interface OutputSchema
OutputSchema
to
tell Pig what the expected output is. This can be used in place
of EvalFunc.outputSchema(Schema)
The default implementation of EvalFunc.outputSchema(Schema)
will look at this annotation and return an interpreted schema, if the annotation is present.
Implementing a custom EvalFunc.outputSchema(Schema)
will
override the annotation (unless you deal with it explicitly, or by calling super.outputSchema(schema)
).
Here's an example of a complex schema declared in an annotation:
@OutputSchema("y:bag{t:tuple(len:int,word:chararray)}")
public abstract String value
Copyright © 2007-2012 The Apache Software Foundation