-
Notifications
You must be signed in to change notification settings - Fork 288
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
adding code for bigquery policy tag extractor #398
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for this contribution @karcot1 ! Can you please move this into the scripts/ directory
@danieldeleo done! Please review when you get the chance. Thanks! |
Co-authored-by: Daniel De Leo <[email protected]>
@danieldeleo thanks for the suggested changes! Commits are done and ready for review. |
|
||
if [ "${TAG_COUNT}" -ge 1 ] | ||
then | ||
COLUMN_AND_TAG=`bq show --format=prettyjson ${DATASET}.${TABLE} | jq '.schema.fields[] | select(.policyTags | length>=1)'` |
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.
This doesn't handle RECORD type columns with nested policy tags. Can you either handle it in code or make an explicit callout in README that this script only handles simple column types.
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.
@danieldeleo added a line to the Considerations section of the README calling this out. Will work on updating the code to handle nested tags in the future.
Co-authored-by: Daniel De Leo <[email protected]>
…oogleCloudPlatform#399) * adding anti pattern recognition step to optimization scripts * using viewable_queries_grouped_by_hash for anti pattern processing * moving anti pattern recognition tool steps to separate script * fixing bug in column names * fixing bug in column names * adding anti pattern script, accounting for null has * adding anti pattern script, supporting multiple executions * adding anti pattern script, addressing duplicate hashes * adding anti pattern script, addressing duplicate hashes * making anti pattern opitmization script generic for any input table, removing query column from queries_grouped_by_hash at org level, adding a project level version of queries_grouped_by_hash * updating readme with examples on how to execute the anti pattern optimization script * updating readme with examples on how to execute the anti pattern optimization script and removing test file * changing location of the anti pattern optimization script for clarity * enhancing readme with instructions to run the anti pattern optimization scripts
PR contains two files