Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/17901#discussion_r115310837
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
---
@@ -1212,22 +1209,27 @@ case class ParseToDate(left: Expression, format:
Option[Expression], child: Expr
/**
* Parses a column to a timestamp based on the supplied format.
*/
-// scalastyle:off line.size.limit
@ExpressionDescription(
- usage = "_FUNC_(timestamp, fmt) - Parses the `left` expression with the
`format` expression to a timestamp. Returns null with invalid input.",
+ usage = """
+ _FUNC_(timestamp[, fmt]) - Parses the `timestamp` expression with the
`format` expression to
+ a timestamp. Returns null with invalid input. Default `fmt` is
'yyyy-MM-dd HH:mm:ss'.
--- End diff --
Also, it seems we documented them here and there
https://github.com/apache/spark/blob/f21897fc157ce467f2b2edb5631b31787883accd/R/pkg/R/functions.R#L1835
in Python and
https://github.com/apache/spark/blob/63d90e7da4913917982c0501d63ccc433a9b6b46/python/pyspark/sql/functions.py#L1014
in R
If the suggestion can be simply done with the format in `SimpleDateFormat`
but in a quick look, it is not. Do you mind if we try this later in a separate
PR?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]