public class XPath extends EvalFunc<java.lang.String>
EvalFunc.SchemaType
log, pigLogger, reporter, returnType
Constructor and Description |
---|
XPath() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
exec(Tuple input)
input should contain: 1) xml 2) xpath 3) optional cache xml doc flag
Usage:
1) XPath(xml, xpath)
2) XPath(xml, xpath, false)
|
java.util.List<FuncSpec> |
getArgToFuncMapping()
Allow a UDF to specify type specific implementations of itself.
|
allowCompileTimeCalculation, finish, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, outputSchema, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public java.lang.String exec(Tuple input) throws java.io.IOException
exec
in class EvalFunc<java.lang.String>
1st
- element should to be the xml
2nd element should be the xpath
3rd optional boolean cache flag (default true)
This UDF will cache the last xml document. This is helpful when multiple consecutive xpath calls are made for the same xml document.
Caching can be turned off to ensure that the UDF's recreates the internal javax.xml.xpath.XPath for every calljava.io.IOException
public java.util.List<FuncSpec> getArgToFuncMapping() throws FrontendException
EvalFunc
getArgToFuncMapping
in class EvalFunc<java.lang.String>
FrontendException
Copyright © 2007-2012 The Apache Software Foundation