-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fixed inconsistency when creating account_map view #487
Open
dnabic-aws
wants to merge
7
commits into
aws-samples:main
Choose a base branch
from
dnabic-aws:fix/inconsistent_account_map
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+36
−31
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b3a889c
Aake sql query out of code. Set the same columns in account_map when …
37c41ec
create account_map view as from template instead from python code
a7ed504
create account_map table from template, not from code
161a4c4
Revert "create account_map view as from template instead from python …
b00c157
revert changes as those files are not used any more
ee6699a
removed account_email_id column in account_map
bd2d7e5
* removed email column from account_map view
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
CREATE OR REPLACE VIEW account_map AS | ||
SELECT | ||
${account_id} AS account_id, | ||
MAX_BY(${account_name}, concat(${account_name}, ': ', ${account_id}) AS account_name | ||
FROM | ||
MAX_BY(${account_name}, concat(${account_name}, ': ', ${account_id})) AS account_name, | ||
${account_id} AS parent_account_id, | ||
CAST('' AS varchar) account_status | ||
FROM | ||
${metadata_table_name} | ||
WHERE | ||
WHERE | ||
${account_name} <> '' | ||
GROUP BY | ||
GROUP BY | ||
${account_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
CREATE OR REPLACE VIEW ${athena_view_name} AS | ||
CREATE OR REPLACE VIEW ${athena_view_name} AS | ||
SELECT DISTINCT | ||
line_item_usage_account_id account_id, | ||
MAX_BY(bill_payer_account_id, line_item_usage_start_date) parent_account_id, | ||
MAX_BY(line_item_usage_account_id, line_item_usage_start_date) account_name, | ||
MAX_BY(line_item_usage_account_id, line_item_usage_start_date) account_email_id | ||
MAX_BY(bill_payer_account_id, line_item_usage_start_date) parent_account_id, | ||
CAST('' AS varchar) account_status | ||
FROM | ||
"${cur_table_name}" | ||
WHERE | ||
line_item_usage_account_id <> '' | ||
GROUP BY | ||
line_item_usage_account_id | ||
line_item_usage_account_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE OR REPLACE VIEW ${athena_view_name} AS | ||
SELECT | ||
* | ||
FROM | ||
( VALUES ${rows} ) | ||
ignored_table_name (account_id, account_name, parent_account_id, account_status) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Here is fixed missing closing bracket. Without fix, dashboard deployment will crash.