Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table gcp_storage_object. Closes #459 #460

Merged
merged 5 commits into from
Jun 27, 2023

Conversation

karanpopat
Copy link
Contributor

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
select
  bucket,
  count(*) as total_objects,
  sum(size) as total_size_bytes
from
  gcp_storage_bucket_object
group by
  bucket;

+-----------------------------------------------------------+---------------+------------------+
| bucket                                                    | total_objects | total_size_bytes |
+-----------------------------------------------------------+---------------+------------------+
| dataproc-81d7c6b8-6d8c-4b04-af65-1bf0751bd6fd-us-east1    | 24            | 6977205          |
| dataproc-e8a44e2b-a18a-403f-a10f-75f15145c765-us-central1 | 6             | 25191            |
| dataproc-staging-asia-southeast2-979620418102-a1jautgv    | 1             | 4213             |
| gcf-sources-979620418102-us-central1                      | 12            | 1508778          |
| kp-bucket-22-7-23                                         | 1             | 38961            |
| kp-test1-22-7-23                                          | 1             | 38961            |
+-----------------------------------------------------------+---------------+------------------+

Time: 4.2s. Rows fetched: 45. Hydrate calls: 0.

@karanpopat karanpopat requested a review from ParthaI June 22, 2023 15:57
@karanpopat karanpopat linked an issue Jun 22, 2023 that may be closed by this pull request
Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karanpopat Please see review comments, thanks!

},
List: &plugin.ListConfig{
KeyColumns: plugin.OptionalColumns([]string{"bucket"}),
ParentHydrate: listGcpStorageBuckets,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use a parent hydrate for this table, as there could be a lot of buckets with a lot of objects, so if someone runs select * from gcp_storage_object, they could be waiting a long time (we made the same decision with aws_s3_object.


func tableGcpBucketStorageObject(_ context.Context) *plugin.Table {
return &plugin.Table{
Name: "gcp_storage_bucket_object",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Name: "gcp_storage_bucket_object",
Name: "gcp_storage_object",

Even though TF calls it gcp_storage_bucket_object, I think we should deviate here, unless this new name is ambiguous and there are other GCP Storage objects

@karanpopat karanpopat changed the title Add table gcp_storage_bucket_object. Closes #459 Add table gcp_storage_object. Closes #459 Jun 23, 2023
@karanpopat karanpopat requested a review from cbruno10 June 23, 2023 15:02
Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karanpopat Thanks for making the previous changes, left 1 more, please have a look, thanks!

@karanpopat karanpopat requested a review from cbruno10 June 27, 2023 18:32
@cbruno10 cbruno10 merged commit fbbd976 into main Jun 27, 2023
@cbruno10 cbruno10 deleted the 459-add-table-gcp_storage_object branch June 27, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table gcp_storage_object
2 participants