June 2018
Beginner to intermediate
210 pages
5h 12m
English
Since Hive v2.1.0, the data-mask function has been available in SQL as built-in UDF. Masking data is quite often requested for user-sensitive data such as credit card numbers, bank account numbers, and passwords. Different from the hash function, the mask function in SQL can specify masking on partial data, which makes it more flexible when you want to keep part of the data unmasked for better understanding. The following are examples of using various mask functions in HQL:
> SELECT -- big letter to U, small letter to l, number to #> mask("Card-0123-4567-8910", "U", "l", "#") as m0, -- mask first n (4) values where X|x for big/small letter, n for number> mask_first_n("Card-0123-4567-8910", 4) as m1, -- mask last ...Read now
Unlock full access