diff options
author | Daoyuan Wang <daoyuan.wang@intel.com> | 2015-07-30 11:13:15 -0700 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2015-07-30 11:14:09 -0700 |
commit | 6d94bf6ac10ac851636c62439f8f2737f3526a2a (patch) | |
tree | ce92a2b1aef8d09726dedd624135d4cfbf19f358 /unsafe/src | |
parent | 06b6a074fb224b3fe23922bdc89fc5f7c2ffaaf6 (diff) | |
download | spark-6d94bf6ac10ac851636c62439f8f2737f3526a2a.tar.gz spark-6d94bf6ac10ac851636c62439f8f2737f3526a2a.tar.bz2 spark-6d94bf6ac10ac851636c62439f8f2737f3526a2a.zip |
[SPARK-8174] [SPARK-8175] [SQL] function unix_timestamp, from_unixtime
unix_timestamp(): long
Gets current Unix timestamp in seconds.
unix_timestamp(string|date): long
Converts time string in format yyyy-MM-dd HH:mm:ss to Unix timestamp (in seconds), using the default timezone and the default locale, return null if fail: unix_timestamp('2009-03-20 11:30:01') = 1237573801
unix_timestamp(string date, string pattern): long
Convert time string with given pattern (see [http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html]) to Unix time stamp (in seconds), return null if fail: unix_timestamp('2009-03-20', 'yyyy-MM-dd') = 1237532400.
from_unixtime(bigint unixtime[, string format]): string
Converts the number of seconds from unix epoch (1970-01-01 00:00:00 UTC) to a string representing the timestamp of that moment in the current system time zone in the format of "1970-01-01 00:00:00".
Jira:
https://issues.apache.org/jira/browse/SPARK-8174
https://issues.apache.org/jira/browse/SPARK-8175
Author: Daoyuan Wang <daoyuan.wang@intel.com>
Closes #7644 from adrian-wang/udfunixtime and squashes the following commits:
2fe20c4 [Daoyuan Wang] util.Date
ea2ec16 [Daoyuan Wang] use util.Date for better performance
a2cf929 [Daoyuan Wang] doc return null instead of 0
f6f070a [Daoyuan Wang] address comments from davies
6a4cbb3 [Daoyuan Wang] temp
56ded53 [Daoyuan Wang] rebase and address comments
14a8b37 [Daoyuan Wang] function unix_timestamp, from_unixtime
Diffstat (limited to 'unsafe/src')
0 files changed, 0 insertions, 0 deletions