[MINOR][DOCS] Correct date_trunc docs

## What changes were proposed in this pull request?

`date_trunc` argument order was flipped, phrasing was awkward.

## How was this patch tested?

Documentation-only.

Closes #24522 from mojodna/patch-2.

Authored-by: Seth Fitzsimmons <seth@mojodna.net>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
This commit is contained in:
Seth Fitzsimmons 2019-05-04 09:13:23 +09:00 committed by HyukjinKwon
parent c66ec43945
commit 5182aa25f0

View file

@ -2943,8 +2943,8 @@ object functions {
*
* @param date A date, timestamp or string. If a string, the data must be in a format that can be
* cast to a date, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss.SSSS`
* @param format: 'year', 'yyyy', 'yy' for truncate by year,
* or 'month', 'mon', 'mm' for truncate by month
* @param format: 'year', 'yyyy', 'yy' to truncate by year,
* or 'month', 'mon', 'mm' to truncate by month
*
* @return A date, or null if `date` was a string that could not be cast to a date or `format`
* was an invalid value
@ -2958,11 +2958,11 @@ object functions {
/**
* Returns timestamp truncated to the unit specified by the format.
*
* For example, `date_tunc("2018-11-19 12:01:19", "year")` returns 2018-01-01 00:00:00
* For example, `date_trunc("year", "2018-11-19 12:01:19")` returns 2018-01-01 00:00:00
*
* @param format: 'year', 'yyyy', 'yy' for truncate by year,
* 'month', 'mon', 'mm' for truncate by month,
* 'day', 'dd' for truncate by day,
* @param format: 'year', 'yyyy', 'yy' to truncate by year,
* 'month', 'mon', 'mm' to truncate by month,
* 'day', 'dd' to truncate by day,
* Other options are: 'second', 'minute', 'hour', 'week', 'month', 'quarter'
* @param timestamp A date, timestamp or string. If a string, the data must be in a format that
* can be cast to a timestamp, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss.SSSS`