[WIP][SPARK-40652][SQL] Add MASK_PHONE and TRY_MASK_PHONE functions to redact phone number string values#38101
Closed
dtenedor wants to merge 16 commits intoapache:masterfrom
dtenedor:mask-phone
Closed
[WIP][SPARK-40652][SQL] Add MASK_PHONE and TRY_MASK_PHONE functions to redact phone number string values#38101dtenedor wants to merge 16 commits intoapache:masterfrom dtenedor:mask-phone
dtenedor wants to merge 16 commits intoapache:masterfrom
dtenedor:mask-phone
Conversation
fetch latest from master
initial implementation initial implementation more testing more testing
merge from base branch
fetch from base branch
|
Can one of the admins verify this patch? |
respond to code review comments
Contributor
Author
|
@gengliangwang @HyukjinKwon @vinodkc FYI, it looks like there is a duplication of planned effort between this PR and https://issues.apache.org/jira/browse/SPARK-40686. We should probably dedup these into one effort. @vinodkc do you want to take this on, and I can close my Jira and help with the review? |
Contributor
Author
|
Going to close this in favor of the other effort by @vinodkc instead |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Add MASK_PHONE and TRY_MASK_PHONE functions to redact phone number string values.
Each of these functions converts a string 'input' representing a phone number to an updated version applying a transformation to the characters. This can be useful for creating copies of tables with sensitive information removed, but retaining the same schema.
Both functions return an error if the format string is invalid.
MASK_PHONE returns an error if the input string does not match the format string.
TRY_MASK_PHONE instead returns NULL in that case.
The format can consist of the following characters, case insensitive:
No other format characters are allowed.
Examples:
This PR also adds
MASK_DIGITSas an alias forMASK_CCNsince it is possible to specify any format string for custom digit masking use cases, e.g. social security numbers.Why are the changes needed?
These functions are useful for processing string values.
Does this PR introduce any user-facing change?
Yes, it adds new SQL functions.
How was this patch tested?
This PR adds a new unit test suite.