From 5182aa25f017fe7ef3616e8f4459296d13dbb716 Mon Sep 17 00:00:00 2001 From: Seth Fitzsimmons Date: Sat, 4 May 2019 09:13:23 +0900 Subject: [PATCH] [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 Signed-off-by: HyukjinKwon --- .../main/scala/org/apache/spark/sql/functions.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala index f92bf792a2..1abda54518 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala @@ -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`