Reading a file from S3 into spark framework

Hi All,

Not able to read a file from s3 into spark framework due to error.

library(aws.s3)
library(sparklyr)
library(data.table)
library(digest)

Sys.setenv("AWS_ACCESS_KEY_ID" = "XXX",
           "AWS_SECRET_ACCESS_KEY" = "XXXX",
           "AWS_DEFAULT_REGION" = "XXX")

sc <- spark_connect(master = "local")

test_data <- spark_read_csv(
  sc,
  name = "data",
  memory = FALSE,
  path = "s3://xxxx/Data_10_04_2020.csv",
  infer_schema='FALSE',
  columns = list("EmailAddress" = "character"))

test <- as.data.table(test_data)

Below is the error

Error: java.io.IOException: No FileSystem for scheme: s3

Any help much appreciated

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.