Skip to content

Commit

Permalink
Re-add win_rank_tdata()
Browse files Browse the repository at this point in the history
  • Loading branch information
mgirlich committed Aug 22, 2023
1 parent c2a1911 commit 12c71f1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ export(win_current_group)
export(win_current_order)
export(win_over)
export(win_rank)
export(win_rank_tdata)
export(win_recycled)
export(window_frame)
export(window_order)
Expand Down
23 changes: 23 additions & 0 deletions R/backend-teradata.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,26 @@ sql_table_analyze.Teradata <- function(con, table, ...) {
}

utils::globalVariables(c("ATAN2", "SUBSTR", "DECIMAL", "WEEKNUMBER_OF_YEAR", "SUM"))

#' @export
#' @rdname win_over
win_rank_tdata <- function(f) {
lifecycle::deprecate_soft(
"2.4.0",
what = "win_rank_tdata()",
with = "win_rank()"
)

force(f)
function(order_by = NULL) {
order_by <- order_by %||% win_current_group()
if (is_empty(order_by)) order_by <- sql("(SELECT NULL)")

win_over(
sql(glue("{f}()")),
partition = win_current_group(),
order = order_by,
frame = win_current_frame()
)
}
}
5 changes: 4 additions & 1 deletion man/win_over.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12c71f1

Please sign in to comment.