@@ -2487,19 +2487,21 @@ object functions {
24872487 */
24882488 def current_timestamp (): Column = withExpr { CurrentTimestamp () }
24892489
2490+ // scalastyle:off line.size.limit
24902491 /**
24912492 * Converts a date/timestamp/string to a value of string in the format specified by the date
24922493 * format given by the second argument.
24932494 *
24942495 * A pattern could be for instance `dd.MM.yyyy` and could return a string like '18.03.1993'. All
2495- * pattern letters of ` java. text.SimpleDateFormat` can be used.
2496+ * pattern letters of [[ https://docs.oracle.com/javase/8/docs/api/ java/text/SimpleDateFormat.html java. text.SimpleDateFormat]] can be used.
24962497 *
24972498 * @note Use when ever possible specialized functions like [[year ]]. These benefit from a
24982499 * specialized implementation.
24992500 *
25002501 * @group datetime_funcs
25012502 * @since 1.5.0
25022503 */
2504+ // scalastyle:on line.size.limit
25032505 def date_format (dateExpr : Column , format : String ): Column = withExpr {
25042506 DateFormatClass (dateExpr.expr, Literal (format))
25052507 }
@@ -2647,7 +2649,11 @@ object functions {
26472649 }
26482650
26492651 /**
2650- * Gets current Unix timestamp in seconds.
2652+ * Returns the current Unix timestamp (in seconds).
2653+ *
2654+ * NOTE: All calls of `unix_timestamp` within the same query return the same value
2655+ * (i.e. the current timestamp is calculated at the start of query evaluation).
2656+ *
26512657 * @group datetime_funcs
26522658 * @since 1.5.0
26532659 */
@@ -2657,22 +2663,27 @@ object functions {
26572663
26582664 /**
26592665 * Converts time string in format yyyy-MM-dd HH:mm:ss to Unix timestamp (in seconds),
2660- * using the default timezone and the default locale, return null if fail.
2666+ * using the default timezone and the default locale.
2667+ * Returns `null` if fails.
2668+ *
26612669 * @group datetime_funcs
26622670 * @since 1.5.0
26632671 */
26642672 def unix_timestamp (s : Column ): Column = withExpr {
26652673 UnixTimestamp (s.expr, Literal (" yyyy-MM-dd HH:mm:ss" ))
26662674 }
26672675
2676+ // scalastyle:off line.size.limit
26682677 /**
2669- * Convert time string with given pattern
2670- * (see [http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html])
2671- * to Unix time stamp (in seconds), return null if fail.
2678+ * Converts time string with given pattern to Unix timestamp (in seconds).
2679+ * Returns `null` if fails.
2680+ *
2681+ * @see [[http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html Customizing Formats ]]
26722682 * @group datetime_funcs
26732683 * @since 1.5.0
26742684 */
2675- def unix_timestamp (s : Column , p : String ): Column = withExpr {UnixTimestamp (s.expr, Literal (p)) }
2685+ // scalastyle:on
2686+ def unix_timestamp (s : Column , p : String ): Column = withExpr { UnixTimestamp (s.expr, Literal (p)) }
26762687
26772688 /**
26782689 * Convert time string to a Unix timestamp (in seconds).
0 commit comments