<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Masking timestamps in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-timestamps/m-p/203924#M76969</link>
    <description>&lt;P&gt;It's not elegant, but this custom masking seems to work.&lt;/P&gt;&lt;PRE&gt;cast(mask(cast(to_date({col}) as date), 'x', 'x', 'x', -1, '1', 1, 0, -1) as timestamp)&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Apr 2018 04:30:01 GMT</pubDate>
    <dc:creator>laura_ngo</dc:creator>
    <dc:date>2018-04-09T04:30:01Z</dc:date>
    <item>
      <title>Masking timestamps</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-timestamps/m-p/203923#M76968</link>
      <description>&lt;P&gt;Is there a way of masking timestamps using the masking policies in Ranger? Perhaps through a custom UDF referenced in the policy?&lt;/P&gt;&lt;P&gt;The masking type of "Date: show only year" only works for dates, not timestamps.&lt;/P&gt;&lt;P&gt;Looking at GitHub (as the Ranger documentation isn't complete) timestamps cannot be masked, only nullified - &lt;A href="https://github.com/myui/hive-udf-backports/tree/master/src/main/java/org/apache/hadoop/hive/ql/udf/generic" target="_blank"&gt;https://github.com/myui/hive-udf-backports/tree/master/src/main/java/org/apache/hadoop/hive/ql/udf/generic&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;mask(value, upperChar, lowerChar, digitChar, otherChar, numberChar, dayValue, monthValue, yearValue)

Supported types: TINYINT, SMALLINT, INT, BIGINT, STRING, VARCHAR, CHAR, DATE
&lt;/PRE&gt;&lt;P&gt;Reason: some systems store dates as timestamps, so date of birth (PII) could be stored as a timestamp and I need to mask it.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 07:54:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-timestamps/m-p/203923#M76968</guid>
      <dc:creator>laura_ngo</dc:creator>
      <dc:date>2018-04-08T07:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Masking timestamps</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-timestamps/m-p/203924#M76969</link>
      <description>&lt;P&gt;It's not elegant, but this custom masking seems to work.&lt;/P&gt;&lt;PRE&gt;cast(mask(cast(to_date({col}) as date), 'x', 'x', 'x', -1, '1', 1, 0, -1) as timestamp)&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Apr 2018 04:30:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-timestamps/m-p/203924#M76969</guid>
      <dc:creator>laura_ngo</dc:creator>
      <dc:date>2018-04-09T04:30:01Z</dc:date>
    </item>
  </channel>
</rss>

