cloudyr / aws.s3

Amazon Simple Storage Service (S3) API Client
https://cloud.r-project.org/package=aws.s3
381 stars 148 forks source link

Read .gz file from s3 #117

Closed xie67 closed 7 years ago

xie67 commented 7 years ago

I've used get_object to get a gz file into raw vector. However, when I used memDecompress, it showed internal error. Is there any solutions?

The code is following: x.gz <- get_object("XXXXX.gz",bucket="XXXXX") x <- memDecompress(x.gz,"gizp")

leeper commented 7 years ago

Can you make a fully reproducible example for me (e.g., use a built-in R dataset, upload the gzip'd object using put_object() and then show the corresponding error using get_object())? Thanks.

xie67 commented 7 years ago

It will be like this. Could you give me some suggestions? I am not good at using R.

put_object(file = "video_events_feed_20170219161605_part_0.gz", object = "video_events_feed_20170219161605_part_0.gz", bucket = "tsymedia") [1] TRUE x.gz <- get_object("video_events_feed_20170219161605_part_0.gz", bucket = "tsymedia") x <- memDecompress(x.gz, "gzip", asChar = TRUE) Error in memDecompress(x.gz, "gzip", asChar = TRUE) : internal error -3 in memDecompress(2)

leeper commented 7 years ago

Duplicate of https://github.com/cloudyr/aws.s3/issues/59