org.apache.hadoop.hive.ql.udf
Class UDFParseUrl
java.lang.Object
org.apache.hadoop.hive.ql.exec.UDF
org.apache.hadoop.hive.ql.udf.UDFParseUrl
public class UDFParseUrl
- extends UDF
UDF to extract specfic parts from URL For example,
parse_url('http://facebook.com/path/p1.php?query=1', 'HOST') will return
'facebook.com' For example,
parse_url('http://facebook.com/path/p1.php?query=1', 'PATH') will return
'/path/p1.php' parse_url('http://facebook.com/path/p1.php?query=1', 'QUERY')
will return 'query=1'
parse_url('http://facebook.com/path/p1.php?query=1#Ref', 'REF') will return
'Ref' parse_url('http://facebook.com/path/p1.php?query=1#Ref', 'PROTOCOL')
will return 'http' Possible values are
HOST,PATH,QUERY,REF,PROTOCOL,AUTHORITY,FILE,USERINFO Also you can get a value
of particular key in QUERY, using syntax QUERY: eg: QUERY:k1.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDFParseUrl
public UDFParseUrl()
evaluate
public String evaluate(String urlStr,
String partToExtract)
evaluate
public String evaluate(String urlStr,
String partToExtract,
String key)
Copyright © 2013 The Apache Software Foundation