Github user anabranch commented on the issue:
https://github.com/apache/spark/pull/16138
@felixcheung Just tried that it doesn't seem to work.
Here's the strange thing, it should follow the *exact* same structure as
[unix_timestamp](https://github.com/apache/spark/blob/master/R/pkg/R/functions.R#L3015)
except that I don't have a signature that takes 0 parameters (i.e.,
[unix_timestamp
L3031](https://github.com/apache/spark/blob/master/R/pkg/R/functions.R#L3031).
Now if I copy and paste the `unix_timestamp` section and change the names,
it **will compile**. However as soon as I remove the first function (like
L3031, that takes no parameters). It will fail again with the same error.
I also tried removing everything and just creating one function at a time.
just this code will work.
```
#' to_date
#'
#' Converts the column into DateType, optionally with a format. Returns
null if input is invalid.
#' Specify formats according to:
http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html
#'
#' @param x Column to parse.
#' @param format string to use to parse x Column to DateType.
#'
#' @rdname to_date
#' @name to_date
#' @family datetime_funcs
#' @aliases to_date,Column-method
#' @export
#' @examples
#' \dontrun{
#' to_date(df$c, 'yyyy-MM-dd')
#' }
#' @note to_date(Column, format) since 2.2.0
setMethod("to_date",
signature(x = "Column"),
function(x) {
jc <- callJStatic("org.apache.spark.sql.functions", "to_date",
x@jc)
column(jc)
})
```
However if I add *any* other parameters to that method (or signature). It
will fail.
---
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]