Description
For date type parameters, mask() UDF replaces year/month/day field values with the values given in arguments to the UDF. Argument value -1 is treated as special, to specify that mask() should retain the value in the parameter. This allows to selectively mask only year/month/day fields.
Specifying "-1" does not retain the values for day/month fields; however the year value is retained, as shown below.
0: jdbc:hive2://localhost:10000> select id, join_date from employee where id < 4; +-----+-------------+--+ | id | join_date | +-----+-------------+--+ | 1 | 2012-01-01 | | 2 | 2014-02-01 | | 3 | 2013-03-01 | +-----+-------------+--+ 3 rows selected (0.435 seconds) 0: jdbc:hive2://localhost:10000> select id, mask(join_date, -1, -1, -1, -1,-1, -1,-1,-1) join_date from employee where id < 4; +-----+-------------+--+ | id | join_date | +-----+-------------+--+ | 1 | 2012-01-01 | | 2 | 2014-01-01 | | 3 | 2013-01-01 | +-----+-------------+--+ 3 rows selected (0.344 seconds)
Attachments
Attachments
Issue Links
- relates to
-
HIVE-13568 Add UDFs to support column-masking
-
- Closed
-
- links to