Prakhar Gupta created SPARK-24378:
-------------------------------------
Summary: Incorrect examples for date_trunc function in spark 2.3.0
Key: SPARK-24378
URL: https://issues.apache.org/jira/browse/SPARK-24378
Project: Spark
Issue Type: Bug
Components: Documentation
Affects Versions: 2.3.0
Reporter: Prakhar Gupta
Fix For: 2.3.0
Within Spark documentation for spark 2.3.0, Listed examples are incorrect.
date_trunc(fmt, ts) - Returns timestamp {{ts}} truncated to the unit specified
by the format model {{fmt}}. {{fmt}} should be one of ["YEAR", "YYYY", "YY",
"MON", "MONTH", "MM", "DAY", "DD", "HOUR", "MINUTE", "SECOND", "WEEK",
"QUARTER"]
*Examples:*
{{> SELECT date_trunc('2015-03-05T09:32:05.359', 'YEAR'); 2015-01-01T00:00:00 >
SELECT date_trunc('2015-03-05T09:32:05.359', 'MM'); 2015-03-01T00:00:00 >
SELECT date_trunc('2015-03-05T09:32:05.359', 'DD'); 2015-03-05T00:00:00 >
SELECT date_trunc('2015-03-05T09:32:05.359', 'HOUR'); 2015-03-05T09:00:00 }}
{{Examples should be date_trunc(format, value)}}
{{SELECT date_trunc('YEAR','2015-03-05T09:32:05.359'); }}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]