-
Notifications
You must be signed in to change notification settings - Fork 0
IN 1200 - Remove 2019 data cutoff #204
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
Conversation
Why these changes are being introduced: It was determined that filtering data older than 2019-01-01 is not needed and should no longer be performed by the data loader. How this addresses that need: * Removes SQL filtering for 2019-01-01 * Filtering for more recent data will be done client-side in Quickbase Side effects of this change: * Increased row counts for all tables touched Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1200
row_number() over ( | ||
partition by MIT_ID | ||
order by APPT_BEGIN_DATE desc, APPT_END_DATE desc | ||
) as termination_txn_row_num | ||
from HR_APPT_ACTION_DETAIL ad | ||
left join HR_PERSONNEL_ACTION_TYPE at on at.HR_PERSONNEL_ACTION_TYPE_KEY = ad.HR_PERSONNEL_ACTION_TYPE_KEY | ||
where at.HR_PERSONNEL_ACTION in ('Retirement','Termination') | ||
), | ||
last_appt_termination_txn as ( | ||
select * from appt_termination_txns | ||
where termination_txn_row_num = 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.
The addition of the row_number()
sorts the termination reasons, and the new last_appt_termination_txn
CTE allows for getting only the most recent one, i.e. the "last" termination reason.
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.
I follow! Hmm, is there every a scenario like the following?:
[{
"APPT_BEGIN_DATE": "2024-01-01",
"APPT_END_DATE": "2025-01-01",
"termination_txn_row_num": 1
},
{
"APPT_BEGIN_DATE": "2023-12-31"
"APPT_END_DATE": "2025-02-01"
"termination_txn_row_num": 2
}]
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.
Looks good to me! Just a couple of questions (non-blocking).
@@ -11,6 +11,7 @@ CHANGELOG | |||
- 2024-05-13 Query created and added | |||
- 2024-06-03 Limit rows to appointments that end on or before 2019-01-01 | |||
- 2024-06-05 Do not filter on benefits types | |||
- 2025-02-05 Remove 2019-01-01 date cutoff entirely |
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.
Hmm, curious why you included this in the changelog if no changes -- beyond this updated comment -- are present in this script?
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.
Maybe it got lost in the diff, but this was removed in this file:
where a.APPT_END_DATE >= TO_DATE('2019-01-01', 'YYYY-MM-DD')
row_number() over ( | ||
partition by MIT_ID | ||
order by APPT_BEGIN_DATE desc, APPT_END_DATE desc | ||
) as termination_txn_row_num | ||
from HR_APPT_ACTION_DETAIL ad | ||
left join HR_PERSONNEL_ACTION_TYPE at on at.HR_PERSONNEL_ACTION_TYPE_KEY = ad.HR_PERSONNEL_ACTION_TYPE_KEY | ||
where at.HR_PERSONNEL_ACTION in ('Retirement','Termination') | ||
), | ||
last_appt_termination_txn as ( | ||
select * from appt_termination_txns | ||
where termination_txn_row_num = 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.
I follow! Hmm, is there every a scenario like the following?:
[{
"APPT_BEGIN_DATE": "2024-01-01",
"APPT_END_DATE": "2025-01-01",
"termination_txn_row_num": 1
},
{
"APPT_BEGIN_DATE": "2023-12-31"
"APPT_END_DATE": "2025-02-01"
"termination_txn_row_num": 2
}]
Purpose and background context
It was determined that filtering data older than
2019-01-01
is not needed and should no longer be performed by the data loader.How this addresses that need:
2019-01-01
How can a reviewer manually see the effects of these changes?
Not possible at this time.
Includes new or updated dependencies?
NO
Changes expectations for external applications?
NO
What are the relevant tickets?
Developer
Code Reviewer(s)