Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/pkg/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ exportMethods("%<=>%",
"conv",
"cos",
"cosh",
"cot",
"count",
"count_distinct",
"countDistinct",
Expand Down
13 changes: 13 additions & 0 deletions R/pkg/R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,19 @@ setMethod("cosh",
column(jc)
})

#' @details
#' \code{cot}: Returns the cotangent of the given value.
#'
#' @rdname column_math_functions
#' @aliases cot cot,Column-method
#' @note cot since 3.3.0
setMethod("cot",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should also add it into R/pkg/R/generics.R, and add a simple test at R/pkg/tests/fulltests/test_sparkSQL.R.

Also, let's create a separate JIRA for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just added.
So, if I add a new function, should I make a JIRA ticket and PR separately just for R implementation?

signature(x = "Column"),
function(x) {
jc <- callJStatic("org.apache.spark.sql.functions", "cot", x@jc)
column(jc)
})

#' Returns the number of items in a group
#'
#' This can be used as a column aggregate function with \code{Column} as input,
Expand Down