Extended ASCII characters in Oracle Text blob not loading into HIVE correctly, showing as '?' instead

北战南征 提交于 2019-12-02 17:02:10

问题


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.

来源:https://stackoverflow.com/questions/57127790/extended-ascii-characters-in-oracle-text-blob-not-loading-into-hive-correctly-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!