Skip to content

Commit

Permalink
Enforce integer n for lag() (#2162, @kevinushey).
Browse files Browse the repository at this point in the history
This resolves an issue in stricter SQL engines where `double` values are not accepted.
  • Loading branch information
kevinushey authored and krlmlr committed Dec 6, 2016
1 parent a353ec5 commit 5baf524
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/translate-sql-base.r
Expand Up @@ -203,7 +203,7 @@ base_win <- sql_translator(
},
lag = function(x, n = 1L, default = NA, order = NULL) {
over(
build_sql("LAG", list(x, n, default)),
build_sql("LAG", list(x, as.integer(n), default)),
partition_group(),
order %||% partition_order()
)
Expand Down

0 comments on commit 5baf524

Please sign in to comment.