hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Update of "Hive/LanguageManual/UDF" by PaulYang
Date Tue, 17 Nov 2009 22:42:35 GMT
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 PaulYang.
http://wiki.apache.org/hadoop/Hive/LanguageManual/UDF?action=diff&rev1=26&rev2=27

--------------------------------------------------

  ||int ||year(string date) ||Return the year part of a date or a timestamp string: year("1970-01-01
00:00:00") = 1970, year("1970-01-01") = 1970||
  ||int ||month(string date) ||Return the month part of a date or a timestamp string: month("1970-11-01
00:00:00") = 11, month("1970-11-01") = 11||
  ||int ||day(string date) ||Return the day part of a date or a timestamp string: day("1970-11-01
00:00:00") = 1, day("1970-11-01") = 1 ||
+ ||int ||weekofyear(string date) ||Return the week number of a timestamp string: weekofyear("1970-11-01
00:00:00") = 44, weekofyear("1970-11-01") = 44 ||
  ||int ||datediff(string enddate, string startdate) ||Return the number of days from startdate
to enddate: datediff('2009-03-01', '2009-02-27') = 2 ||
  ||int ||date_add(string startdate, int days) ||Add a number of days to startdate: date_add('2008-12-31',
1) = '2009-01-01' ||
  ||int ||date_sub(string startdate, int days) ||Substract a number of days to startdate:
date_sub('2008-12-31', 1) = '2008-12-30' ||
@@ -107, +108 @@

  The following are built-in String functions are supported in hive:
  || int || length(string A) || returns the length of the string ||
  ||string || reverse(string A) || returns the reversed string ||
- ||string ||concat(string A, string B)||returns the string resulting from concatenating B
after A e.g. concat('foo', 'bar') results in 'foobar'||
+ ||string ||concat(string A, string B...)||returns the string resulting from concatenating
the strings passed in as parameters in order. e.g. concat('foo', 'bar') results in 'foobar'.
Note that this function can take any number of input strings.||
  ||string ||substr(string A, int start) ||returns the substring of A starting from start
position till the end of string A e.g. concat('foobar', 4) results in 'bar' (see [[[http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr||
MySQL substr]]])||
  ||string ||substr(string A, int start, int len) ||returns the substring of A starting from
start position with length len e.g. concat('foobar', 4, 1) results in 'b' (see [[[http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr||
MySQL substr]]]) ||
  ||string ||upper(string A)||returns the string resulting from converting all characters
of A to upper case e.g. upper('fOoBaR') results in 'FOOBAR'||

Mime
View raw message