Jack Sengar
Jack Sengar

Reputation: 351

Ruby reading file content from GSC bucket without downloading the actual file

I am quite new to Google Cloud Storage. I want to read the CSV file content form the GCS bucket and get the single column data that too without downloading the actual file. I have tried this and got the column data after downloading and then reading the file content.

Upvotes: 0

Views: 830

Answers (1)

rahul mishra
rahul mishra

Reputation: 1470

The API of google.cloud.storage.blob.Blob specifies that the download_as_string method has start and end keywords that provide byte ranges:

ref: https://googleapis.github.io/google-cloud-python/latest/storage/blobs.html#google.cloud.storage.blob.Blob

In ruby there is one issue is create for the same to read specified bytes https://github.com/googleapis/google-cloud-ruby/issues/1356

You need to check its implemented or not but yes Its Do able

Upvotes: 1

Related Questions