Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not dropping default argument to lag() on Redshift #251

Open
louisahsmith opened this issue Sep 27, 2023 · 0 comments
Open

Not dropping default argument to lag() on Redshift #251

louisahsmith opened this issue Sep 27, 2023 · 0 comments

Comments

@louisahsmith
Copy link

I am connecting to a redshift db using DatabaseConnector and writing code in dplyr. The lag() function has an argument default = NULL that is not supported by redshift, so it gets dropped by dbplyr (see tidyverse/dbplyr#549.) This is not getting dropped when connecting via DatabaseConnector, resulting in

java.sql.SQLException: [Amazon](500310) Invalid operation: Default parameter not be supported for window function lag;

That is,

con <- DatabaseConnector::connect(
    dbms = "redshift", 
    ...
)
dbplyr::translate_sql(lag(x), con = con)

returns

<SQL> LAG(x, 1, NULL) OVER ()

but should return

<SQL> LAG(`x`, 1) OVER ()

as with dbplyr::translate_sql(lag(x), con = dbplyr::simulate_redshift())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant