Details
-
Documentation
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
2.3.0
-
None
Description
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'); }}
Attachments
Issue Links
- is duplicated by
-
SPARK-25686 date_trunc Spark SQL function silently returns null if parameters are swapped
- Resolved
- relates to
-
SPARK-21914 Running examples as tests in SQL builtin function documentation
- Resolved
- links to