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 ZhengShao
Date Tue, 02 Jun 2009 03:26:22 GMT
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 ZhengShao:
http://wiki.apache.org/hadoop/Hive/LanguageManual/UDF

------------------------------------------------------------------------------
  ||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 ||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' ||
  
  === Conditional Functions ===
  ||T ||if(boolean testCondition, T valueTrue, T valueFalseOrNull) ||Return valueTrue when
testCondition is true, returns valueFalseOrNull otherwise ||

Mime
View raw message