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 enum 
     

    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

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VespaDocumentOperation

      public VespaDocumentOperation(String... params)
  • Method Details

    • exec

      public String exec(org.apache.pig.data.Tuple tuple) throws IOException
      Specified by:
      exec in class org.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 id
      fields - Fields to put in document operation
      Returns:
      A valid JSON Vespa document operation
      Throws:
      IOException - ...