Skip to content

Commit f6a7060

Browse files
committed
Fix to_timestamp description
1 parent cb4a736 commit f6a7060

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ case class ParseToDate(left: Expression, format: Option[Expression], child: Expr
13701370
}
13711371

13721372
/**
1373-
* Parses a column to a timestamp based on the supplied format.
1373+
* Parses a column to a timestamp in the seconds precision based on the supplied format.
13741374
*/
13751375
@ExpressionDescription(
13761376
usage = """

sql/core/src/main/scala/org/apache/spark/sql/functions.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,10 +2949,10 @@ object functions {
29492949
def unix_timestamp(s: Column, p: String): Column = withExpr { UnixTimestamp(s.expr, Literal(p)) }
29502950

29512951
/**
2952-
* Converts to a timestamp by casting rules to `TimestampType`.
2952+
* Converts to a timestamp by casting rules to `TimestampType` in the seconds precision.
29532953
*
29542954
* @param s A date, timestamp or string. If a string, the data must be in a format that can be
2955-
* cast to a timestamp, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss.SSSS`
2955+
* cast to a timestamp, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss`
29562956
* @return A timestamp, or null if the input was a string that could not be cast to a timestamp
29572957
* @group datetime_funcs
29582958
* @since 2.2.0
@@ -2962,12 +2962,12 @@ object functions {
29622962
}
29632963

29642964
/**
2965-
* Converts time string with the given pattern to timestamp.
2965+
* Converts time string with the given pattern to timestamp in the seconds precision.
29662966
*
29672967
* See [[java.text.SimpleDateFormat]] for valid date and time format patterns
29682968
*
29692969
* @param s A date, timestamp or string. If a string, the data must be in a format that can be
2970-
* cast to a timestamp, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss.SSSS`
2970+
* cast to a timestamp, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss`
29712971
* @param fmt A date time pattern detailing the format of `s` when `s` is a string
29722972
* @return A timestamp, or null if `s` was a string that could not be cast to a timestamp or
29732973
* `fmt` was an invalid format

0 commit comments

Comments
 (0)