Add alternate_group_by_column field to Project and Instance Type group by #1295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds alternate_group_by_columns to the Project and Instance Type group bys. One place the column in
alternate_group_by_column
, when present, is used is in the group by WHERE clause to filter results. If alternate_group_by_column is not specified the column(s) inattribute_to_aggregate_table_key_map
are used instead. For the Project and Instance Type group by's the correct column for WHERE clause is thedisplay
column not theinstance_type_id
specified inattribute_to_aggregate_table_key_map
.An example of the difference in the sql when alternate_group_by_column is used is shown in the Instance Type group by sql below.
Query before change:
Query after change:
I've updated my port (9008) on metrics-dev with the fix.
Tests performed
Tested on port 9008 on metrics-dev
Types of changes
Checklist: