![]() Return the number of days from startdate to enddate: datediff('', '') = 2Īdd a number of days to startdate: date_add('', 1) = '' Return the week number of a timestamp string: weekofyear(" 00:00:00") = 44, weekofyear("") = 44ĭatediff(string enddate, string startdate) Return the day part of a date or a timestamp string: day(" 00:00:00") = 1, day("") = 1 Returns the month part of a date or a timestamp string: month(" 00:00:00") = 11, month("") = 11 Returns the year part of a date or a timestamp string: year(" 00:00:00") = 1970, year("") = 1970 ![]() Returns the date part of a timestamp string: to_date(" 00:00:00") = "" Unix_timestamp(string date, string pattern) Gets current time stamp using the default time zone.Ĭonverts time string in format yyyy-MM-dd HH:mm:ss to Unix time stamp, return 0 if fail: unix_timestamp(' 11:30:01') = 1237573801 ![]() The following built-in collection functions are supported in hive:įrom_unixtime(bigint unixtime)Ĭonverts the number of seconds from unix epoch ( 00:00:00 UTC) to a string representing the timestamp of that moment in the current system time zone in the format of " 00:00:00" Returns the sign of a as '1.0' (if a is positive) or '-1.0' (if a is negative), '0.0' otherwise Returns the tangent of a (a is in radians)Ĭonverts value of a from radians to degreesĬonverts value of a from degrees to radians Returns the arccosine of a if -1<=a<=1 or NULL otherwise Returns the cosine of a (a is in radians) Returns the arc sin of a if -1<=a<=1 or NULL otherwise Pmod(INT a, INT b), pmod(DOUBLE a, DOUBLE b) (BINARY version as of Hive 0.12.0, used to return a string)Ĭonv(BIGINT num, INT from_base, INT to_base), conv(STRING num, INT from_base, INT to_base)Ĭonverts a number from a given base to another Interprets each pair of characters as a hexadecimal number and converts to the byte representation of the number. Otherwise if the number is a STRING, it converts each character into its hex representation and returns the resulting STRING. If the argument is an INT or binary hex returns the number as a STRING in hex format. Hex(BIGINT a) hex(STRING a) hex(BINARY a) Pow(DOUBLE a, DOUBLE p), power(DOUBLE a, DOUBLE p) Return the base-base logarithm of the argument d Returns the base-2 logarithm of the argument a Returns the base-10 logarithm of the argument a Returns the natural logarithm of the argument a ![]() Returns e a where e is the base of the natural logarithm Specifying the seed will make sure the generated random number sequence is deterministic. Returns a random number (that changes from row to row) that is distributed uniformly from 0 to 1. Returns the minimum BIGINT value that is equal or greater than a Returns the maximum BIGINT value that is equal or less than a ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |