org.apache.hadoop.hive.ql.udf
Class UDFParseUrl

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDF
      extended by 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.


Constructor Summary
UDFParseUrl()
           
 
Method Summary
 String evaluate(String urlStr, String partToExtract)
           
 String evaluate(String urlStr, String partToExtract, String key)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
getRequiredFiles, getRequiredJars, getResolver, setResolver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDFParseUrl

public UDFParseUrl()
Method Detail

evaluate

public String evaluate(String urlStr,
                       String partToExtract)

evaluate

public String evaluate(String urlStr,
                       String partToExtract,
                       String key)


Copyright © 2014 The Apache Software Foundation. All rights reserved.