Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

column Data issue after import

Solved Go to solution
Highlighted

column Data issue after import

New Contributor

Hi All,

We are using Oracle as source to extract data using sqoop, In source table(Oracle) there is one column with data type RAW, whose data is getting changed after extracting data (adding to HDFS).

Below is sample data from Source column and target columns after sqoop import,

Issue is :- Adding extra space. 

Source data

A567B4CDAA7109CE31A24DC1F1C585D4B115BBFBF82F49EAB748792E25AE0C767FDC89AFC984D862E579F3F1D8F9B8AEC55CBD8F0AF70F49CE77714AEB99AE5732DCAA0B3A5C71CE6F8DDD18E8CE82D24DF2367D4AD5C85C92FD0551610A241FAD4E69AF243FBAB432CDA011100FD4BD5BD99EB93639FB6F052F7B2849CBF730401F2C30FE6C4BD9A2D0D3667D07B3527AEEFDC0DC2B250F52BFE4A590C9833B356431C406E765B522D6232E8BB1B353

 

Target data

a5 67 b4 cd aa 71 09 ce 31 a2 4d c1 f1 c5 85 d4 b1 15 bb fb f8 2f 49 ea b7 48 79 2e 25 ae 0c 76 7f dc 89 af c9 84 d8 62 e5 79 f3 f1 d8 f9 b8 ae c5 5c bd 8f 0a f7 0f 49 ce 77 71 4a eb 99 ae 57 32 dc aa 0b 3a 5c 71 ce 6f 8d dd 18 e8 ce 82 d2 4d f2 36 7d 4a d5 c8 5c 92 fd 05 51 61 0a 24 1f ad 4e 69 af 24 3f ba b4 32 cd a0 11 10 0f d4 bd 5b d9 9e b9 36 39 fb 6f 05 2f 7b 28 49 cb f7 30 40 1f 2c 30 fe 6c 4b d9 a2 d0 d3 66 7d 07 b3 52 7a ee fd c0 dc 2b 25 0f 52 bf e4 a5 90 c9 83 3b 35 64 31 c4 06 e7 65 b5 22 d6 23 2e 8b b1 b3 53

 

Please help me to resolve this issue.

 

 

Thanks,

Sam

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: column Data issue after import

New Contributor

Hi All,

It got resolved. below is the solutions of same.

 

Columns which are used in import statement are having \n i.e. new line in column data. This new line was separating column data into two rows while importing data. Sqoop is considering \n character as  a new line separator, which is a default setting of sqoop import. We have avoided \n character in column data using parameter --hive-delims-replacement " " .

 

 

Thanks,

Samadhan

3 REPLIES 3

Re: column Data issue after import

Explorer

Not sure if one has to handle RAW field through an extra step of transforming into hexadecimal format per below statement in oracle docs.

 

* RAW binary data in delimited text files must be encoded in hexadecimal.

 

However, I am curious to see if any solution for this issue.

 

Re: column Data issue after import

New Contributor

Hi All,

It got resolved. below is the solutions of same.

 

Columns which are used in import statement are having \n i.e. new line in column data. This new line was separating column data into two rows while importing data. Sqoop is considering \n character as  a new line separator, which is a default setting of sqoop import. We have avoided \n character in column data using parameter --hive-delims-replacement " " .

 

 

Thanks,

Samadhan

Re: column Data issue after import

Explorer

Issue is :- Adding extra space.

 

could not be clear in regard to above point.

 

Good that you could resolve the actual issue.

Don't have an account?
Coming from Hortonworks? Activate your account here