[Author]: kwu
使用sqoop --options-file直接导入hive数据,把操作命令语句写在文件中,便于管理及管理
1、创建hive数据库及表
create database DB_TEST;
CREATE TABLE
UserRegLoginLogvi UserRegLoginLog_hive.opt
import --connect jdbc:jtds:sqlserver://10.130.2.6:1433;;DatabaseName=DB_TEST --username sa --password 123456 --table UserRegLoginLog --where 1=1 --columns " ID ,fld_date ,fld_ip ,fld_server_ip ,fld_UA ,UserId ,UserName ,PassWord ,ActionType ,ActionTime ,ActionIP ,FromHost ,UrlRefer,RemotePort " --fields-terminated-by '\t' --hive-import --hive-overwrite --hive-drop-import-delims --hive-table DB_TELECAST.UserRegLoginLog
sqoop --options-file ./UserRegLoginLog_hive.opt
3、指定hive的数据库,格式为: 数据库.表名
DB_TEST.UserRegLoginLog
使用sqoop --options-file 导入hive数据
原文地址:http://blog.csdn.net/bdchome/article/details/45560067