Package com.yahoo.vespa.hadoop.pig
Class VespaDocumentOperation
- java.lang.Object
-
- org.apache.pig.EvalFunc<String>
-
- com.yahoo.vespa.hadoop.pig.VespaDocumentOperation
-
public class VespaDocumentOperation extends org.apache.pig.EvalFunc<String>
A Pig UDF to convert simple Pig types into a valid Vespa JSON document format.- Author:
- lesters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VespaDocumentOperation.Operation
-
Constructor Summary
Constructors Constructor Description VespaDocumentOperation(String... params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.String
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, outputSchema, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
-
-
-
-
Constructor Detail
-
VespaDocumentOperation
public VespaDocumentOperation(String... params)
-
-
Method Detail
-
exec
public String exec(org.apache.pig.data.Tuple tuple) throws IOException
- 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 IOException
Create 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
- ...
-
-