Modifier and Type | Class and Description |
---|---|
static class |
XPathAll.ARGUMENTS |
EvalFunc.SchemaType
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_STRING |
log, pigLogger, reporter, returnType
Constructor and Description |
---|
XPathAll() |
Modifier and Type | Method and Description |
---|---|
Tuple |
exec(Tuple input)
input should contain: 1) xml 2) xpath 3) optional cache xml doc flag 4)
optional ignore namespace flag
The optional fourth parameter (IGNORE_NAMESPACE), if set true will remove
the namespace from xPath For example xpath /html:body/html:div will be
considered as /body/div
Usage: 1) XPathAll(xml, xpath)
2) XPathAll(xml, xpath, false)
3) XPathAll(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 static final String EMPTY_STRING
public Tuple exec(Tuple input) throws IOException
exec
in class EvalFunc<Tuple>
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<Tuple>
FrontendException
Copyright © 2007-2017 The Apache Software Foundation