Extended ASCII characters in Oracle Text blob not

2020-05-06 04:52发布

问题:

I have text blob data in oracle and I have imported using sqoop into HIVE in Binary. Source blob is textual data with extended ASCII characters in it but in HIVE these special characters are not correct in HIVE.

I have tried by creating table using hcat -e and then loaded data in hive using sqoop with hcatalog.

I have tried using hcatalog. Created table with Blob in oracle, then created equivalent table in HIVE but set as Binary instead of Blob. Insert sample data with text and special charaters, then imported data using Sqoop.

Create table test_blob (col1 integer not null primary key, col2 blob); 

insert into test_blob 
     select rownum, utl_raw.cast_to_raw('Textþ03ý04ýString') from dual connect by level <= 100;
hcat -e "create table TEST_BLOB (col1 bigint, col2 binary) ;" 
sqoop import --connect {connect-info} --table TEST_BLOB --hcatalog-table TEST_BLOB 
select * from test_blob;
col1-col2
1-Text?03?04?String

My expectation is to load extended ASCII characters from source BLOB into HIVE binary or string correctly.