将BLOB(图像)从oracle导入配置单元 [英] Import BLOB (Image) from oracle to hive

查看:219
本文介绍了将BLOB(图像)从oracle导入配置单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  sqoop import  - 使用下面的Sqoop命令来导入BLOB(Image)连接jdbc:oracle:thin:@host --username --password --m 3 --table tablename --hive-drop-import-delims --hive-table tablename --target-dir''--split-by ID; 

但不成功。请记住,BLOB数据以十六进制形式存储在oracle数据库中,我们需要以文本或bianary的形式将它存储到Hive表中。



有什么可行的办法? p>

解决方案

Sqoop不知道如何将Oracle中的blob数据类型映射到Hive。所以你需要指定 - map-column-hive COLUMN_BLOB = binary

  sqoop import --connect'jdbc:oracle:thin:@host'--username $ USER --password $ Password --table $ TABLE --hive-import --hive-table $ HiveTable --map-column- hive COL_BLOB = binary --delete-target-dir --target-dir $ TargetDir -m 1 -verbose 


I am trying to import BLOB(Image)data form oracle to Hive using below Sqoop command.

sqoop import --connect jdbc:oracle:thin:@host --username --password  --m 3 --table tablename  --hive-drop-import-delims  --hive-table tablename --target-dir '' --split-by id;

But unsuccessful. Remember, BLOB Data stored in oracle database as Hexadecimal and we need to store this to Hive table as text or bianary.

What are the possible way to do that?

解决方案

Sqoop does not know how to map blob datatype in oracle into Hive. So You need to specify --map-column-hive COLUMN_BLOB=binary

sqoop import --connect 'jdbc:oracle:thin:@host' --username $USER --password $Password  --table $TABLE  --hive-import --hive-table $HiveTable  --map-column-hive COL_BLOB=binary --delete-target-dir --target-dir $TargetDir  -m 1 -verbose

这篇关于将BLOB(图像)从oracle导入配置单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆