Github user actuaryzhang commented on a diff in the pull request: https://github.com/apache/spark/pull/18114#discussion_r118605422 --- Diff: R/pkg/R/functions.R --- @@ -2476,24 +2430,27 @@ setMethod("from_json", signature(x = "Column", schema = "structType"), column(jc) }) -#' from_utc_timestamp +#' @section Details: +#' \code{from_utc_timestamp}: Given a timestamp, which corresponds to a certain time of day in UTC, +#' returns another timestamp that corresponds to the same time of day in the given timezone. #' -#' Given a timestamp, which corresponds to a certain time of day in UTC, returns another timestamp -#' that corresponds to the same time of day in the given timezone. +#' @rdname column_datetime_functions #' -#' @param y Column to compute on. -#' @param x time zone to use. -#' -#' @family date time functions -#' @rdname from_utc_timestamp -#' @name from_utc_timestamp -#' @aliases from_utc_timestamp,Column,character-method +#' @aliases from_utc_timestamp from_utc_timestamp,Column,character-method #' @export -#' @examples \dontrun{from_utc_timestamp(df$t, 'PST')} +#' @examples +#' +#' \dontrun{ +#' tmp <- mutate(df, from_utc = from_utc_timestamp(df$time, 'PST'), +#' to_utc = to_utc_timestamp(df$time, 'PST'), +#' to_unix = unix_timestamp(df$time), +#' to_unix2 = unix_timestamp(df$time, 'yyyy-MM-dd HH'), +#' from_unix = from_unixtime(unix_timestamp(df$time))) +#' head(tmp)} #' @note from_utc_timestamp since 1.5.0 -setMethod("from_utc_timestamp", signature(y = "Column", x = "character"), - function(y, x) { - jc <- callJStatic("org.apache.spark.sql.functions", "from_utc_timestamp", y@jc, x) +setMethod("from_utc_timestamp", signature(x = "Column", tz = "character"), + function(x, tz) { --- End diff -- Changed the second argument to `tz` to be consistent with Scala, which also makes it less confusing in the doc since other methods also have `y` as argument.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org