Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

mask fields

avatar
Contributor

Dear Team,

 

how can I mask last 5 digits in field below in Kudu?

 

roshanbi_0-1625224570186.png

on Ranger?

Thanks,

 

Roshan

1 ACCEPTED SOLUTION

avatar

Hi @roshanbi 

I think there are really two questions here:

  • For each row of my data set, can I mask the last 5 digits of each data element present in the pri_identity column using Ranger?
  • Is this possible to achieve while using Kudu?

I'll restrict myself to addressing the first question. Your second question is a good one, though, because most of the documentation I've read about this simply doesn't mention Kudu, so I'll leave that part of your question to another community member who has more experience with Apache Kudu as a storage option. You didn't provide the version of either Impala, Ranger or Kudu you're using or on what distribution, but I will attempt to point you in the right direction nonetheless.

 

You can see a quick demonstration of why and how to use a mask in Ranger on CDP in the first two minutes of this video:

How to use Column Masking and Row Filtering in CDP

You can see a slightly longer length demonstration of how to do something similar on HDP 3.1.x in this video:

How to mask Hive columns using Atlas tags and Ranger

Neither quite shows how to establish the custom masking expression, though, which is what I think you'll need to satisfy your requirements.

 

To suppress the display of the last 5 digits in the pri_identity column, you are likely to need a custom masking expression for use in Ranger. Ranger includes several "out of the box" masking types, but a cursory look at the documentation indicates that the masking policy you've described and desire is not one of them. If that's true, you can always write a custom masking expression using the UDF syntax, which you can read about at the Apache.org site here:

Hive Operators and User-Defined Functions (UDFs)

 

Hope this helps

 

 

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

1 REPLY 1

avatar

Hi @roshanbi 

I think there are really two questions here:

  • For each row of my data set, can I mask the last 5 digits of each data element present in the pri_identity column using Ranger?
  • Is this possible to achieve while using Kudu?

I'll restrict myself to addressing the first question. Your second question is a good one, though, because most of the documentation I've read about this simply doesn't mention Kudu, so I'll leave that part of your question to another community member who has more experience with Apache Kudu as a storage option. You didn't provide the version of either Impala, Ranger or Kudu you're using or on what distribution, but I will attempt to point you in the right direction nonetheless.

 

You can see a quick demonstration of why and how to use a mask in Ranger on CDP in the first two minutes of this video:

How to use Column Masking and Row Filtering in CDP

You can see a slightly longer length demonstration of how to do something similar on HDP 3.1.x in this video:

How to mask Hive columns using Atlas tags and Ranger

Neither quite shows how to establish the custom masking expression, though, which is what I think you'll need to satisfy your requirements.

 

To suppress the display of the last 5 digits in the pri_identity column, you are likely to need a custom masking expression for use in Ranger. Ranger includes several "out of the box" masking types, but a cursory look at the documentation indicates that the masking policy you've described and desire is not one of them. If that's true, you can always write a custom masking expression using the UDF syntax, which you can read about at the Apache.org site here:

Hive Operators and User-Defined Functions (UDFs)

 

Hope this helps

 

 

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.