开发手册 欢迎您!
软件开发者资料库

Apache Tajo - 日期时间函数

Apache Tajo DateTime函数 - 从简单和简单的步骤学习Apache Tajo,从基本概念到高级概念,包括简介,体系结构,安装,配置设置,Shell命令,数据类型,运算符,SQL函数,数学函数,字符串函数,日期时间函数,JSON函数,数据库创建,表管理,SQL语句,聚合和窗口函数,SQL查询,存储插件,与HBase集成,与Hive集成,OpenStack Swift集成,JDBC接口,自定义函数。

Apache Tajo支持以下DateTime函数.

S.No.Function & Description
1add_days(date date or timestamp, int day

Returns date added by the given day value.

2add_months(date date or timestamp, int month)

Returns date added by the given month value.

3current_date()

Returns today’s date.

4current_time()

Returns today’s time.

5extract(century from date/timestamp)

Extracts century from the given parameter.

6extract(day from date/timestamp)

Extracts day from the given parameter.

7extract(decade from date/timestamp)

Extracts decade from the given parameter.

8extract(day dow date/timestamp)

Extracts day of week from the given parameter.

9extract(doy from date/timestamp)

Extracts day of year from the given parameter.

10select extract(hour from timestamp)

Extracts hour from the given parameter.

11select extract(isodow from timestamp)

Extracts day of week from the given parameter. This is identical to dow except for Sunday. This matches the ISO 8601 day of the week numbering.

12select extract(isoyear from date)

Extracts ISO year from the specified date. ISO year may be different from the Gregorian year.

13extract(microseconds from time)

Extracts microseconds from the given parameter. The seconds field, including fractional parts, multiplied by 1 000 000;

14extract(millennium from timestamp )

Extracts millennium from the given parameter.one millennium corresponds to 1000 years. Hence, the third millennium started January 1, 2001.

15extract(milliseconds from time)

Extracts milliseconds from the given parameter.

16extract(minute from timestamp )

Extracts minute from the given parameter.

17extract(quarter from timestamp)

Extracts quarter of the year(1 - 4) from the given parameter.

18date_part(field text, source date or timestamp or time)

Extracts date field from text.

19now()

Returns current timestamp.

20to_char(timestamp, format text)

Converts timestamp to text.

21to_date(src text, format text)

Converts text to date.

22to_timestamp(src text, format text)

Converts text to timestamp.