Here is the code:
library(sparklyr)
sc <- spark_connect(master = "local", config = list())
iris_tbl <- copy_to(sc, iris, overwrite = T)
newColList <- c("a", "b" , "c" , "d" , " e")
colnames(iris_tbl) <- newColList
Error:
Error in colnames<- ( tmp, value = c("a", "b", "c", "d", " e")) : 'dimnames' applied to non-array