-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(gcp_storage_object): add prefix filter to storage object list #475
feat(gcp_storage_object): add prefix filter to storage object list #475
Conversation
Hydrate: listStorageObjects, | ||
KeyColumns: []*plugin.KeyColumn{ | ||
{Name: "bucket", Require: plugin.Required, CacheMatch: "exact"}, | ||
{Name: "prefix", Require: plugin.Optional}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ question : Why you need prefix in key column ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "prefix" in the key columns is added as an optional parameter, meaning it's not required for the function to operate, but if it's provided, it can be used to narrow down the returned results based on the prefix of the object keys in the Google Cloud Storage bucket.
As for the "prefix" field in the table definition, it's a pseudo-column. This means it doesn't actually exist in the Google Cloud Storage Object data, but it is used to provide an additional filter (the prefix in this case) when querying the table. The transform.FromQual("prefix") is used to take the value from the query qualifier and add it to the request. This way, it's possible to write a query like select * from gcp_storage_object where prefix = 'your-prefix', and the results would be only the objects that have keys starting with 'your-prefix'.
daa8a2c
to
6b70e2c
Compare
@villers Thanks so much for the contribution! |
add prefix filter to storage object list
Integration test logs
Logs
Example query results
Results