0
votes

I am trying to read a csv file from aws datalake using R.

I used the below code to read the data, unfortunately I am getting an error

Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input

I am using the below code,

aws.signature::use_credentials()
c<- get_object("s3://datalake-1/x-data/")
cobj<- rawToChar(c)
con<- textConnection(cobj)
data <- read.csv(con)
close(con)
data
1

1 Answers

0
votes

It looks like the file is not present at the address/URI provided. Unable to reproduce this error so, maybe look for your CSV's correct location.

Apart from that I'd also put the read statement within tryCatch as referenced in an already existing answer linked here