-
Notifications
You must be signed in to change notification settings - Fork 11
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
Create repsetdata script #111
base: sel-rep-codi
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.
LGTM
Co-authored-by: Samir Shetty <[email protected]>
Co-authored-by: Samir Shetty <[email protected]>
I'd recommend running ShellCheck when developing Bash scripts. There's even a handy VSCode plugin for it. |
Co-authored-by: Samir Shetty <[email protected]>
repsetdata.sh
Outdated
OUTPUT_NAME="variables-by-replication-set-$(date +"%Y_%m_%d_%I_%M_%s").csv" | ||
SELECT_STATEMENT=$(cat <<EOF | ||
SELECT | ||
RTRIM(LTRIM(REPLACE(CAST(replication_sets AS varchar), '{}', 'Full' ), '{'),'}') AS "ReplicationSets", |
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 replication_sets
column is of the format {repset1,repset2,repset3}
Since the script outputs a CSV, we may want to confirm that if a variable belongs to multiple replication sets, the output does not get mangled if each replication set is considered a separate 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.
@imheresamir We looked at this yesterday and multiple replication sets will be in a single column. However that was before we removed the leading or trailing { }. I'll let @kmacinnis confirm and check if this will causes issue..
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.
Local testing results in the following:
ReplicationSets,Policy,Variable
"follower1,follower2",default:policy:root,vault-synchronizer/lob-1/safe-1/variable-1
Which could be ok depending on requirements. I would expect there to be separate lines for each replication set for each variable belonging to multiple replication sets, like this:
ReplicationSet,Policy,Variable
follower1,default:policy:root,vault-synchronizer/lob-1/safe-1/variable-1
follower2,default:policy:root,vault-synchronizer/lob-1/safe-1/variable-1
That way the ReplicationSet
column can be filtered in Excel.
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.
Couple more comments
There are numerous trailing whitespace characters in the script that are not visible in the GitHub view. Do you mind removing those? VSCode has a handy "Trailing Spaces" extension which identifies and removes them for you. |
Co-authored-by: Samir Shetty <[email protected]>
Co-authored-by: Samir Shetty <[email protected]>
…jur-intro into data-viz-rep-set
Co-authored-by: Samir Shetty <[email protected]>
Just want people to check this over, it shouldn't be merged to this branch.