Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.
The "Hive/LanguageManual/UDF" page has been changed by Andreas Quandt. The comment on this change is: Previous syntax incorrect. Correct syntax per https://issues.apache.org/jira/browse/HIVE-563 and http://hadoop.apache.org/hive/docs/current/api/org/apache/hadoop/hive/ql/udf/UDFParseUrl.html. http://wiki.apache.org/hadoop/Hive/LanguageManual/UDF?action=diff&rev1=45&rev2=46 -------------------------------------------------- ||string ||rtrim(string A) ||Returns the string resulting from trimming spaces from the end(right hand side) of A e.g. rtrim(' foobar ') results in ' foobar' || ||string ||regexp_replace(string A, string B, string C) ||Returns the string resulting from replacing all substrings in B that match the Java regular expression syntax(See Java regular expressions syntax) with C e.g. regexp_replace("foobar", "oo|ar", "") returns 'fb.' Note that some care is necessary in using predefined character classes: using '\s' as the second argument will match the letter s; '\\s' is necessary to match whitespace, etc. || ||string ||regexp_extract(string subject, string pattern, int intex) ||Returns the string extracted using the pattern. e.g. regexp_extract('foothebar', 'foo(.*?)(bar)', 2) returns 'bar.' Note that some care is necessary in using predefined character classes: using '\s' as the second argument will match the letter s; '\\s' is necessary to match whitespace, etc. || - ||string ||parse_url(string urlString, string partToExtract) ||Returns the specified part from the URL. Valid values for partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and USERINFO. e.g. parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'HOST') returns 'facebook.com' Also a value of particular key in QUERY can be extracted using the syntax QUERY:<KEY_NAME> e.g. QUERY:k1. || + ||string ||parse_url(string urlString, string partToExtract [, string keyToExtract]) ||Returns the specified part from the URL. Valid values for partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and USERINFO. e.g. parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'HOST') returns 'facebook.com'. Also a value of a particular key in QUERY can be extracted by providing the key as the third argument, e.g. parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY', 'k1') returns 'v1'. || ||string ||get_json_object(string json_string, string path) ||Extract json object from a json string based on json path specified, and return json string of the extracted json object. It will return null if the input json string is invalid || ||string ||space(int n) ||Return a string of n spaces || ||string ||repeat(string str, int n) ||Repeat str n times ||
