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

Sparklyr rename fails with dev version of dplyr #2776

Closed
MZLABS opened this issue May 14, 2017 · 3 comments
Closed

Sparklyr rename fails with dev version of dplyr #2776

MZLABS opened this issue May 14, 2017 · 3 comments

Comments

@MZLABS
Copy link

MZLABS commented May 14, 2017

Rename fails in Sparklyr, think it depends on verison of dplyr. Definitely seeing it in the dev version of dplyr as of 5-14-2017.

# devtools::install_github("tidyverse/dplyr")
# devtools::install_github('tidyverse/dbplyr')
suppressPackageStartupMessages(library('dplyr'))
packageVersion("dplyr")
## [1] '0.5.0.9004'
library('sparklyr')
packageVersion("sparklyr")
## [1] '0.5.4'
if(requireNamespace("dbplyr", quietly = TRUE)) {
  packageVersion("dbplyr")
}
## [1] '0.0.0.9001'
R.Version()$version.string
## [1] "R version 3.4.0 (2017-04-21)"
dLocal <- data.frame(x = 1:2,
                     origCol = c('a', 'b'),
                     stringsAsFactors = FALSE)

sc <- sparklyr::spark_connect(version='2.0.2', 
   master = "local")

d <- copy_to(sc, dLocal, 'd')

# works
rename(dLocal, x2 = x, origCol2 = origCol)
##   x2 origCol2
## 1  1        a
## 2  2        b
# throws
rename(d, x2 = x, origCol2 = origCol)
## Source:     lazy query [?? x 2]
## Database:   spark_connection

## Error in names(select)[match(old_vars, vars)] <- new_vars: NAs are not allowed in subscripted assignments
spark_disconnect(sc)
rm(list=ls())
gc(verbose = FALSE)
@hadley
Copy link
Member

hadley commented May 15, 2017

Please just file as a sparklyr issue.

@hadley hadley closed this as completed May 15, 2017
@JohnMount
Copy link

JohnMount commented Jun 9, 2017

Filed as sparklyr issue 678. Issue remains with 0.7.0 dplyr plus current (2017-06-09) dev sparklyr. (dbplyr changes depending which of sparklyr or dplyr is installed last.) Had file here to try and help package to package coordination.

suppressPackageStartupMessages(library('dplyr'))
packageVersion("dplyr")
#> [1] '0.7.0'
library('sparklyr')
packageVersion("sparklyr")
#> [1] '0.5.5.9002'
if(requireNamespace("dbplyr", quietly = TRUE)) {
  packageVersion("dbplyr")
}
#> [1] '0.0.0.9001'
R.Version()$version.string
#> [1] "R version 3.4.0 (2017-04-21)"

dLocal <- data.frame(x = 1:2,
                     origCol = c('a', 'b'),
                     stringsAsFactors = FALSE)

sc <- sparklyr::spark_connect(version='2.0.2', 
                              master = "local")

d <- copy_to(sc, dLocal, 'd')

# works
rename(dLocal, x2 = x, origCol2 = origCol)
#>   x2 origCol2
#> 1  1        a
#> 2  2        b

# throws
rename(d, x2 = x, origCol2 = origCol)
#> Error in names(select)[match(old_vars, vars)] <- new_vars: NAs are not allowed in subscripted assignments

@JohnMount
Copy link

JohnMount commented Jun 14, 2017

Looks related to dplyr 2860.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
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

3 participants