sqoop将数据导入配置单元 [英] sqoop to import data to hive
问题描述
我正在尝试使用sqoop2将数据导入配置单元表。我正在使用 - hive-import
但它不起作用
代码:
sqoop import --connect jdbc:sqlserver://192.168.x.xxx:11xx --username user --password user --table xxxx.NOTIFICATION --hive-import
错误:
错误manager.SqlManager:执行语句错误:com.microsoft.sqlserver.jdbc.SQLServerException:无效的对象名称'XXXX.NOTIFICATION'。
我做错了什么?
我使用sqoop2,所以我改变了我的命令,并在下面使用了一个它为我工作。
$ $ p $ $ sqoop import --connectjdbc:sqlserver://192.168.x.xxx:11xx ; database = SSSS; username = user; password = user--querySELECT * FROM xxxx.NOTIFICATION where \ $ CONDIT IONS--split-by xxxx.NOTIFICATION.ID --hive-import --hive-table NOTIFICATION --target-dir NOTIFICATION
之前,我们应该使用 create
命令在配置单元中创建表。在这里我创建了名为 NOTIFICATION
的配置单元表。
i am trying to import data to hive table using sqoop2. I am using --hive-import
but it is not working
Code:
sqoop import --connect jdbc:sqlserver://192.168.x.xxx:11xx --username user --password user --table xxxx.NOTIFICATION --hive-import
Error:
ERROR manager.SqlManager: Error executing statement: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'XXXX.NOTIFICATION'.
What am I doing wrong?
Hi after doing a bit research and discussing on the question with @dev i found the solution.
I am using sqoop2 so i changed my command and used below one and it worked for me.
$ sqoop import --connect "jdbc:sqlserver://192.168.x.xxx:11xx;database=SSSS;username=user;password=user" --query "SELECT * FROM xxxx.NOTIFICATION where \$CONDITIONS" --split-by xxxx.NOTIFICATION.ID --hive-import --hive-table NOTIFICATION --target-dir NOTIFICATION
before executing this command we should create table in hive using create
command. Here i have created hive table named NOTIFICATION
.
这篇关于sqoop将数据导入配置单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!