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

feature request: case_when() TRUE should translate to ELSE #3688

Closed
namarkus opened this issue Jun 20, 2018 · 2 comments
Closed

feature request: case_when() TRUE should translate to ELSE #3688

namarkus opened this issue Jun 20, 2018 · 2 comments

Comments

@namarkus
Copy link

sql translation of case_when() has no else clause

case_when works just fine with dataframes. Using it in a database environment, I'm missing the possibility of defining an else-clause:

translate_sql(case_when(
  height > 200 | mass > 200 ~ "large",
  species == "Droid"        ~ "robot",
  TRUE                      ~  "other"
))

translates to:
(...) WHEN (TRUE) THEN ('other') END
whereas it should translate to:
(...) ELSE ('other') END

@ghost
Copy link

ghost commented Jun 20, 2018

This issue was moved by batpigandme to tidyverse/dbplyr/issues/102.

@ghost ghost closed this as completed Jun 20, 2018
@lock
Copy link

lock bot commented Dec 17, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Dec 17, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant