尝试将Impala中的timestamp字段的数据加载到Oracle时,Sqoop导出数据抛出错误

时间:2019-04-10 16:52:45

标签: oracle hadoop timestamp hdfs sqoop

我正在尝试使用Sqoop导出将Impala表中的数据导出到Oracle表,但是在尝试执行Sqoop导出时出现以下错误

Caused by: java.lang.RuntimeException: Can't parse input data: '2016-08-01 00:00:00'

我正在使用以下命令运行Sqoop导出:

sqoop export --connection-param-file /home/rahul/connection.properties --connect jdbc:oracle:thin:@oralce_hostname:1521:SID --username username --password pwd --direct --export-dir '/user/hive/warehouse/exp_txt.db/export_demo' --table SqoopExport.export_demo --fields-terminated-by '\0 01'

根据Hortonworks(https://community.hortonworks.com/content/supportkb/154095/unable-to-generate-sqoop-query-based-on-the-date-d.html)网站的建议,我添加具有以下属性的属性文件

oracle.jdbc.mapDateToTimestamp=false,但仍然出现相同的错误

Impala表如下

CREATE TABLE exp_txt.export_demo(
  id_1 INT,                         
  id_2 INT,                                       
  valid_start_date DATE,               
  valid_end_date DATE                 
)                                                 
row format delimited
fields terminated by '\001'                                   
STORED AS TEXTFILE; 

Oracle表如下

    CREATE TABLE export_demo (
      id_1          INTEGER         NOT NULL,
      id_2          INTEGER         NOT NULL,
      valid_start_date      DATE            NOT NULL,
      valid_end_date        DATE            NOT NULL
      )

;

0 个答案:

没有答案