public class VespaQuery
extends org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
Modifier and Type | Field and Description |
---|---|
private com.yahoo.vespa.hadoop.mapreduce.util.VespaConfiguration |
configuration |
private com.yahoo.vespa.hadoop.mapreduce.util.VespaHttpClient |
httpClient |
private Properties |
properties |
private String |
PROPERTY_QUERY_SCHEMA |
private String |
PROPERTY_QUERY_TEMPLATE |
private String |
PROPERTY_ROOT_NODE |
private String |
queryRootNode |
private String |
querySchema |
private String |
queryTemplate |
Constructor and Description |
---|
VespaQuery() |
VespaQuery(String... params) |
Modifier and Type | Method and Description |
---|---|
private org.apache.pig.data.DataBag |
createPigRepresentation(com.fasterxml.jackson.databind.JsonNode hits) |
private String |
createVespaQueryUrl(org.apache.pig.data.Tuple input) |
org.apache.pig.data.DataBag |
exec(org.apache.pig.data.Tuple input) |
private String |
executeVespaQuery(String url) |
org.apache.pig.impl.logicalLayer.schema.Schema |
outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input) |
private com.fasterxml.jackson.databind.JsonNode |
parseVespaResultJson(String result) |
private com.fasterxml.jackson.databind.JsonNode |
queryVespa(org.apache.pig.data.Tuple input) |
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
private final String PROPERTY_QUERY_TEMPLATE
private final String PROPERTY_QUERY_SCHEMA
private final String PROPERTY_ROOT_NODE
private final com.yahoo.vespa.hadoop.mapreduce.util.VespaConfiguration configuration
private final Properties properties
private final String queryTemplate
private final String querySchema
private final String queryRootNode
private com.yahoo.vespa.hadoop.mapreduce.util.VespaHttpClient httpClient
public VespaQuery()
public VespaQuery(String... params)
public org.apache.pig.data.DataBag exec(org.apache.pig.data.Tuple input) throws IOException
exec
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
IOException
public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
outputSchema
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
private com.fasterxml.jackson.databind.JsonNode queryVespa(org.apache.pig.data.Tuple input) throws IOException
IOException
private String createVespaQueryUrl(org.apache.pig.data.Tuple input) throws IOException
IOException
private String executeVespaQuery(String url) throws IOException
IOException
private com.fasterxml.jackson.databind.JsonNode parseVespaResultJson(String result) throws IOException
IOException
private org.apache.pig.data.DataBag createPigRepresentation(com.fasterxml.jackson.databind.JsonNode hits)
Copyright © 2018. All rights reserved.