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

explain() plan fails with redshift database but works if a line in backend-postgres.R is removed #740

Closed
rmcd1024 opened this issue Dec 23, 2021 · 0 comments · Fixed by #798

Comments

@rmcd1024
Copy link

I'm using dbplyr with redshift. The explain function fails with an error but works if I comment out a line in backend-postgres.R.

I construct a dplyr expression named (e.g.) dbquery and then explain(dbquery). The sql translation is printed but the plan is not. I consistently get the following error:

<PLAN>
Error: Failed to prepare query: ERROR:
LINE 1: EXPLAIN (FORMAT text) SELECT *
                 ^
syntax error at or near "FORMAT"

The function backend-postgres.R contains this code

  build_sql(
    "EXPLAIN ",
    (!is.null(format)) sql(paste0("(FORMAT ", format, ") ")),
    sql,
    con = con
  )

If I comment out the line beginning (!is.null, the explain function works.

I apologize for not offering a reprex, but I don't have access to a public redshift database.

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

Successfully merging a pull request may close this issue.

1 participant