Wednesday, May 15, 2019

DataEng: GCS: Writting contents into GCP Bucket



Prior to writing an object to the Bucket, it is a good idea to verify what's in it first.

This can be achieved by using gsutil utility from activating Cloud Shell.




xxxxx@cloudshell:~ (datalab-project-1-239921)$ gsutil ls -l
gs://datalab-project-1-239921/
gs://test-create-bucket-2-32321/
xxxxx@cloudshell:~ (datalab-project-1-239921)$ gsutil ls -l gs://test-create-bucket-2-32321/
  76398379  2019-05-10T21:23:46Z  gs://test-create-bucket-2-32321/Events_Export.csv
      7340  2019-05-10T21:47:55Z  gs://test-create-bucket-2-32321/entity.csv
TOTAL: 2 objects, 76405719 bytes (72.87 MiB)
xxxxx@cloudshell:~ (datalab-project-1-239921)$






Executing the data insertion in Jupyter Notebook, this will create an insert-text.text with text in it.


xxxxx@cloudshell:~ (datalab-project-1-239921)$ gsutil ls -l gs://test-create-bucket-2-32321/
  76398379  2019-05-10T21:23:46Z  gs://test-create-bucket-2-32321/Events_Export.csv
      7340  2019-05-10T21:47:55Z  gs://test-create-bucket-2-32321/entity.csv
        13  2019-05-13T21:06:30Z  gs://test-create-bucket-2-32321/insert-text.text
TOTAL: 3 objects, 76405732 bytes (72.87 MiB)
xxxxx@cloudshell:~ (datalab-project-1-239921)$gsutil cat gs://test-create-bucket-2-32321/insert-text.text
Inserted text


No comments:

Post a Comment

Pandas: SQL Like pandas operations

Pandas's SQL Like operations such as WHERE clause. = != >= str.contains() & | .isin() .isnull() .notnull() ....