We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
dbplyr::compute.tbl_sql()
As a reproducible example:
sc <- sparklyr::spark_connect(master = "local") mtcars_spark <- dplyr::copy_to(dest = sc, df = mtcars) name <- c(name = "test") qry <- dplyr::sql("select mpg from mtcars") res <- sparklyr::sdf_sql(sc = sc, sql = qry) out <- dplyr::compute(x = res, name = name) # Error: org.apache.spark.sql.catalyst.parser.ParseException: # mismatched input '`name`' expecting {'(', 'SELECT', 'FROM', 'WITH', 'VALUES', 'TABLE', 'INSERT', 'MAP', 'REDUCE'}(line 2, pos 10) # # == SQL == # CREATE TEMPORARY VIEW # `test` AS `name` AS SELECT `mpg` # ----------^^^ # FROM `sparklyr_tmp_5c748cbd_9398_4dff_8c4e_f46939c88eb8`
FWIW, this seems to have become an issue after we upgraded from dbplyr 1.4.2 to 2.1.0.
The text was updated successfully, but these errors were encountered:
Minimal reprex:
library(dbplyr) library(dplyr, warn.conflicts = FALSE) db <- memdb_frame(x = 1:10) compute(db, c("foo" = "bar")) #> Error: near "`foo`": syntax error
Created on 2021-04-01 by the reprex package (v1.0.0)
But could you just not supply a named vector?
Sorry, something went wrong.
Sure, in theory. But our particular use case uses named vectors. For now, we are just using dplyr::compute(x = res, name = unname(name))
dplyr::compute(x = res, name = unname(name))
compute()
name
Successfully merging a pull request may close this issue.
As a reproducible example:
FWIW, this seems to have become an issue after we upgraded from dbplyr 1.4.2 to 2.1.0.
The text was updated successfully, but these errors were encountered: