Remove mailing names and address associated with suppresion requests from address view#1040
Conversation
jeancochrane
left a comment
There was a problem hiding this comment.
Thanks for picking this up so quickly! I have one question about high-level behavior, but otherwise this looks fine to me.
| mail.parid, | ||
| mail.taxyr, | ||
| {{ concat_address(['mail.mail1', 'mail.mail2']) }} | ||
| AS mail_address_name, | ||
| {{ concat_address(['mail.maddr1', 'mail.maddr2']) }} | ||
| AS mail_address_full, | ||
| mail.mcityname AS mail_address_city_name, | ||
| mail.mstatecode AS mail_address_state, | ||
| NULLIF(mail.mzip1, '00000') AS mail_address_zipcode_1, | ||
| NULLIF(mail.mzip2, '0000') AS mail_address_zipcode_2, | ||
| mail.mailseq = MAX(mail.mailseq) | ||
| OVER (PARTITION BY mail.parid, mail.taxyr) AS newest, | ||
| hide.pin AS hide_pin | ||
| FROM {{ source('iasworld', 'maildat') }} AS mail | ||
| LEFT JOIN {{ source('ccao', 'hidename') }} AS hide | ||
| ON mail.parid = hide.pin | ||
| WHERE mail.cur = 'Y' | ||
| AND mail.deactivat IS NULL |
There was a problem hiding this comment.
[Question, non-blocking] Just confirming that this behavior will remove the entire row for every year for every PIN in the source list. Is that the behavior we want @ccao-jardine? Or do we want to preserve the row and replace the non-PIN/year data with indicator values, or nulls?
There was a problem hiding this comment.
The PIN will still have a row in the view, just NULLs for columns from maildat. Could totally change the NULLs to a filler value.
There was a problem hiding this comment.
Oops, that's right, my bad! The current behavior seems like the best option to me, then.
There was a problem hiding this comment.
Thanks for this bandaid and thorough review! Confirming that I do want the PIN to have a row, replacing the contents of the MAILDAT columns with nulls.
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
This PR creates a new table
ccao.hidenamewhich is fed by a list of PINs stored on the O drive. Any PIN from this list will not have any data fromiasworld.maildatsurfaced indefault.vw_pin_address.the difference in null rows is 587, which is exactly what we expect:
gives us 587.
returns no rows.