EvalFunc.SchemaType
log, pigLogger, reporter, returnType
Constructor and Description |
---|
XPath() |
Modifier and Type | Method and Description |
---|---|
String |
exec(Tuple input)
input should contain: 1) xml 2) xpath
3) optional cache xml doc flag
4) optional ignore namespace flag
Usage:
1) XPath(xml, xpath)
2) XPath(xml, xpath, false)
3) XPath(xml, xpath, false, false)
|
List<FuncSpec> |
getArgToFuncMapping()
Returns argument schemas of the UDF.
|
allowCompileTimeCalculation, finish, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, outputSchema, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public String exec(Tuple input) throws IOException
exec
in class EvalFunc<String>
input
- 1st element should to be the xml
2nd element should be the xpath
3rd optional boolean cache flag (default true)
4th optional boolean ignore namespace flag (default true)
This UDF will cache the last xml document. This is helpful when
multiple consecutive xpathAll 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.XPathAll for every call
This UDF will also support ignoring the namespace in the xml tags.
This will help to search xpath items by ignoring its namespace.
Ignoring of the namespace can be turned off for special cases using
a fourth argument in the UDF.IOException
public List<FuncSpec> getArgToFuncMapping() throws FrontendException
getArgToFuncMapping
in class EvalFunc<String>
FrontendException
Copyright © 2007-2017 The Apache Software Foundation