You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2009/07/29 02:19:24 UTC

[Hadoop Wiki] Update of "Hive/LanguageManual/UDF" by EmilIbrishimov

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by EmilIbrishimov:
http://wiki.apache.org/hadoop/Hive/LanguageManual/UDF

------------------------------------------------------------------------------
  ||double ||pow(double a, double p) ||Return a^p||
  ||double ||power(double a, double p) ||Synonym of pow||
  ||double ||sqrt(double a) ||Return the square root of a||
- ||double ||bin(double a) ||Return the number in binary format||
- ||double ||hex(double a) ||Return the number in hex format||
- ||double ||conv(double num, int from_base, int to_base) ||Convert a number from a given base to another||
+ ||string ||bin(BIGINT a) ||Return the number in binary format (see [[http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_bin | MySQL bin]])||
+ ||string ||hex(BIGINT a) ||Return the number in hex format (see [[http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_hex | MySQL hex]]) ||
+ ||string ||conv(BIGINT num, int from_base, int to_base) ||Convert a number from a given base to another (see [[http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_conv | MySQL conv]])||
+ ||double ||abs(double a) ||Return the absolute value||
  
  === Collection Functions ===
  The following built-in collection functions are supported in hive:
@@ -120, +121 @@

  ||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'||
  ||string ||parse_url(string urlString, string partToExtract) ||returns the part from the url. e.g. parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'HOST')  returns 'facebook.com'||
  ||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||
+ ||string ||ascii(string str) ||Return the numeric value of the first character of str||
+ ||string ||lpad(string str1, string str2) ||Pad str1 to the left with str2||
+ ||string ||rpad(string str1, string str2) ||Pad str1 to the right with str2||
+ ||string ||split(string str, string pat) ||Split str around pat (pat is a regular expression)||
  
  ==== get_json_object ====
  A limited version of JSONPath supported: