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

broken SQL translation for #1695

piccolbo opened this Issue Mar 8, 2016 · 1 comment


None yet
2 participants

piccolbo commented Mar 8, 2016

dplyr::translate_sql_q(quote(! (w > 0) w)))


<SQL> "!"

The keyword ENDIS is not part of any SQL dialect I know of and it seems like a space fell through the cracks.
Comparing the defs for and is.null in base_scalar seems to confirm the hypothesis

Browse[2]> base_scalar$``
function (x) 
    build_sql(x, "IS NULL")
<environment: namespace:dplyr>
Browse[2]> base_scalar$`is.null`
function (x) 
    build_sql(x, " IS NULL")
<environment: namespace:dplyr>

@hadley hadley added the database label Mar 8, 2016

@hadley hadley added this to the 0.5 milestone Mar 8, 2016

@hadley hadley closed this in ef923b6 Mar 9, 2016


This comment has been minimized.


hadley commented Mar 9, 2016

I now get:

translate_sql(! (x) y else z))
#> <SQL> NOT((CASE WHEN ("x") THEN ("y") ELSE ("z") END) IS NULL)

I think that's more likely to parse correctly.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.