2

I am extracting data using sqoop. Is there any way to mask any particular column in sqoop or modify each cell. For example:

creditcardinfo
7888-3333-2222-1002
1111-2342-1235-2090
2331-2131-2222-3421   

I want data to be like after ingestion:

creditcardinfo
XXXX-XXXX-XXXX-1002
XXXX-XXXX-XXXX-2090
XXXX-XXXX-XXXX-3421   

or

creditcardinfo
1002
2090
3421  

Is it possible in sqoop?I tried to find out but couldn't get much info.

Hadi
  • 36,233
  • 13
  • 65
  • 124
Alka
  • 267
  • 1
  • 9

1 Answers1

1

The easiest way to do so is using a custom query for your ingestion with sqoop and in the custom query you can perform all the tranformations you want. Youcan take a look at here for reference: https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html#_free_form_query_imports.

mgaido
  • 2,987
  • 3
  • 17
  • 39
  • @mark91-You are right..That way it can be done.Is there any other way forex:java code – Alka May 09 '16 at 08:38
  • sqoop exentially generates a java file which compiles in a jar...you can take that java file and change it. Then you compile it into a jar and you pass that jar to sqoop.. – mgaido May 09 '16 at 08:47