Package com.yahoo.vespa.hadoop.pig
Class VespaDocumentOperation
java.lang.Object
org.apache.pig.EvalFunc<String>
com.yahoo.vespa.hadoop.pig.VespaDocumentOperation
A Pig UDF to convert simple Pig types into a valid Vespa JSON document format.
- Author:
- lesters
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pig.EvalFunc
org.apache.pig.EvalFunc.SchemaType
-
Field Summary
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
create
(VespaDocumentOperation.Operation op, String docId, Map<String, Object> fields, Properties properties, org.apache.pig.impl.logicalLayer.schema.Schema schema) Create a JSON Vespa document operation given the supplied fields, operation and document id template.exec
(org.apache.pig.data.Tuple tuple) Methods inherited from class org.apache.pig.EvalFunc
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, outputSchema, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
-
Constructor Details
-
VespaDocumentOperation
-
-
Method Details
-
exec
- Specified by:
exec
in classorg.apache.pig.EvalFunc<String>
- Throws:
IOException
-
create
public static String create(VespaDocumentOperation.Operation op, String docId, Map<String, Object> fields, Properties properties, org.apache.pig.impl.logicalLayer.schema.Schema schema) throws IOExceptionCreate a JSON Vespa document operation given the supplied fields, operation and document id template.- Parameters:
op
- Operation (put, remove, update)docId
- Document idfields
- Fields to put in document operation- Returns:
- A valid JSON Vespa document operation
- Throws:
IOException
- ...
-