I am trying to copy my data into spark and getting the following error
Error in as.data.frame.default(x, stringsAsFactors = FALSE, row.names = FALSE, : cannot coerce class "structure("SparkDataFrame", package = "SparkR")" to a data.frame
I've looked over the documentation and found nothing that helps
library(SparkR)
DF <- read.df("/FileStore/tables/export.csv", source = "csv", header="true", inferSchema = "true")
library(sparklyr)
library(dplyr)
sc <- spark_connect(method = "databricks")
#This gives the above error
DF_tbl <- sdf_copy_to(sc = sc, x = DF, overwrite = T)