我正在尝试使用sqoop将oracle数据导入到Hive中。 Sqoop从oracle提取数据并将其正确放入hdfs。
但是当应该有配置单元导入部分时-它不起作用。 Sqoop编写了一些信息消息,没有任何错误,但是没有做任何配置单元导入工作。
我的sqoop调用是
sqoop import --connect jdbc:oracle:thin:@host:1521:SID --username username --password password --delete-target-dir --table TEST_SQOOP --hive-import --hive-database db -m 1 -verbose
并获得详细的输出(结尾)
19/06/03 18:28:02 DEBUG hive.TableDefWriter: Create statement: CREATE TABLE IF NOT EXISTS `db`.`TEST_SQOOP` ( `A` DOUBLE, `B` STRING, `D` STRING) COMMENT 'Imported by sqoop on 2019/06/03 18:28:02' ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001' LINES TERMINATED BY '\012' STORED AS TEXTFILE
19/06/03 18:28:02 DEBUG hive.TableDefWriter: Load statement: LOAD DATA INPATH 'hdfs://hadoop/user/airflow/TEST_SQOOP' INTO TABLE `db`.`TEST_SQOOP`
19/06/03 18:28:02 DEBUG ipc.Client: The ping interval is 60000 ms.
19/06/03 18:28:02 DEBUG ipc.Client: Connecting to hadoop-m1/ip:8020
19/06/03 18:28:02 DEBUG ipc.Client: IPC Client (2071364564) connection to hadoop-m1/ip:8020 from airflow: starting, having connections 2
19/06/03 18:28:02 DEBUG ipc.Client: IPC Client (2071364564) connection to hadoop-m1/ip:8020 from airflow sending #779
19/06/03 18:28:02 DEBUG ipc.Client: IPC Client (2071364564) connection to hadoop-m1/ip:8020 from airflow got value #779
19/06/03 18:28:02 DEBUG ipc.ProtobufRpcEngine: Call: getFileInfo took 69ms
19/06/03 18:28:02 INFO hive.HiveImport: Loading uploaded data into Hive
Logging initialized using configuration in jar:file:/usr/hdp/2.5.3.0-37/hive/lib/hive-common-1.2.1000.2.5.3.0-37.jar!/hive-log4j.properties
这些“记录已初始化”是其最后的输出消息
但是Hive中什么也没有发生。未创建表,未加载数据。
如果我通过hive命令手动运行hive,我将能够执行Create Table / LOAD DATA INPATH语句而不会出现问题。
为什么sqoop不做它的Hive工作?