导入失败:从 Oracle 数据库导入 CLOB 数据期间无法转换 SQL 类型 2005==>
Imported Failed: Cannot convert SQL type 2005==> during importing CLOB data from Oracle database
我正在尝试使用 sqoop 导入具有 CLOB 数据类型的 Oracle table 数据,但失败并显示错误 Imported Failed: Cannot convert SQL type 2005
。我正在使用 Running Sqoop version: 1.4.5-cdh5.4.7
.
请帮助我如何导入 CLOB 数据类型。
我正在使用下面的 oozie 工作流程导入数据
<workflow-app xmlns="uri:oozie:workflow:0.4" name="EBIH_Dly_tldb_dly_load_wf">
<credentials>
<credential name="hive2_cred" type="hive2">
<property>
<name>hive2.jdbc.url</name>
<value>${hive2_jdbc_uri}</value>
</property>
<property>
<name>hive2.server.principal</name>
<value>${hive2_server_principal}</value>
</property>
</credential>
</credentials>
<start to="sqp_imp_tldb_table1"/>
<action name="sqp_imp_tldb_table1">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<arg>import</arg>
<arg>-Dmapreduce.output.fileoutputformat.compress=false</arg>
<arg>--connect</arg>
<arg>${connect_string}</arg>
<arg>--username</arg>
<arg>${username}</arg>
<arg>--password</arg>
<arg>${password}</arg>
<arg>--num-mappers</arg>
<arg>8</arg>
<arg>--as-textfile</arg>
<arg>--append</arg>
<arg>--fields-terminated-by</arg>
<arg>|</arg>
<arg>--split-by</arg>
<arg>created_dt</arg>
<arg>--target-dir</arg>
<arg>${sqp_table1_dir}</arg>
<arg>--map-column-hive</arg>
<arg>ID=bigint,XML1=string,XML2=string,APP_PAYLOAD=string,created_dt=date,created_day=bigint</arg>
<arg>--query</arg>
<arg>"select * from schema1.table1 where $CONDITIONS AND trunc(created_dt) BETWEEN to_date('${load_start_date}','yyyy-mm-dd') AND to_date('${load_end_date}','yyyy-mm-dd')"</arg>
</sqoop>
<ok to="dly_load_wf_complete"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="dly_load_wf_complete"/>
</workflow-app>
最后,它在 sqoop 导入选项中添加了一个附加子句 -D oraoop.disabled=true
。
以下有效
<action name="sqp_imp_tldb_table1">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<arg>import</arg>
<arg>-Dmapreduce.output.fileoutputformat.compress=false</arg>
<arg>-Doraoop.disabled=true</arg>
<arg>--connect</arg>
<arg>${connect_string}</arg>
<arg>--username</arg>
<arg>${username}</arg>
<arg>--password</arg>
<arg>${password}</arg>
<arg>--num-mappers</arg>
<arg>8</arg>
<arg>--as-textfile</arg>
<arg>--append</arg>
<arg>--fields-terminated-by</arg>
<arg>\t</arg>
<arg>--split-by</arg>
<arg>created_dt</arg>
<arg>--target-dir</arg>
<arg>${sqp_table1_dir}</arg>
<arg>--map-column-hive</arg>
<arg>ID=bigint,XML1=string,XML2=string,APP_PAYLOAD=string,created_dt=date,created_day=bigint</arg>
<arg>--query</arg>
<arg>"select * from schema1.table1 where $CONDITIONS AND trunc(created_dt) BETWEEN to_date('${load_start_date}','yyyy-mm-dd') AND to_date('${load_end_date}','yyyy-mm-dd')"</arg>
</sqoop>
<ok to="dly_load_wf_complete"/>
<error to="fail"/>
</action>
我正在尝试使用 sqoop 导入具有 CLOB 数据类型的 Oracle table 数据,但失败并显示错误 Imported Failed: Cannot convert SQL type 2005
。我正在使用 Running Sqoop version: 1.4.5-cdh5.4.7
.
请帮助我如何导入 CLOB 数据类型。
我正在使用下面的 oozie 工作流程导入数据
<workflow-app xmlns="uri:oozie:workflow:0.4" name="EBIH_Dly_tldb_dly_load_wf">
<credentials>
<credential name="hive2_cred" type="hive2">
<property>
<name>hive2.jdbc.url</name>
<value>${hive2_jdbc_uri}</value>
</property>
<property>
<name>hive2.server.principal</name>
<value>${hive2_server_principal}</value>
</property>
</credential>
</credentials>
<start to="sqp_imp_tldb_table1"/>
<action name="sqp_imp_tldb_table1">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<arg>import</arg>
<arg>-Dmapreduce.output.fileoutputformat.compress=false</arg>
<arg>--connect</arg>
<arg>${connect_string}</arg>
<arg>--username</arg>
<arg>${username}</arg>
<arg>--password</arg>
<arg>${password}</arg>
<arg>--num-mappers</arg>
<arg>8</arg>
<arg>--as-textfile</arg>
<arg>--append</arg>
<arg>--fields-terminated-by</arg>
<arg>|</arg>
<arg>--split-by</arg>
<arg>created_dt</arg>
<arg>--target-dir</arg>
<arg>${sqp_table1_dir}</arg>
<arg>--map-column-hive</arg>
<arg>ID=bigint,XML1=string,XML2=string,APP_PAYLOAD=string,created_dt=date,created_day=bigint</arg>
<arg>--query</arg>
<arg>"select * from schema1.table1 where $CONDITIONS AND trunc(created_dt) BETWEEN to_date('${load_start_date}','yyyy-mm-dd') AND to_date('${load_end_date}','yyyy-mm-dd')"</arg>
</sqoop>
<ok to="dly_load_wf_complete"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="dly_load_wf_complete"/>
</workflow-app>
最后,它在 sqoop 导入选项中添加了一个附加子句 -D oraoop.disabled=true
。
以下有效
<action name="sqp_imp_tldb_table1">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<arg>import</arg>
<arg>-Dmapreduce.output.fileoutputformat.compress=false</arg>
<arg>-Doraoop.disabled=true</arg>
<arg>--connect</arg>
<arg>${connect_string}</arg>
<arg>--username</arg>
<arg>${username}</arg>
<arg>--password</arg>
<arg>${password}</arg>
<arg>--num-mappers</arg>
<arg>8</arg>
<arg>--as-textfile</arg>
<arg>--append</arg>
<arg>--fields-terminated-by</arg>
<arg>\t</arg>
<arg>--split-by</arg>
<arg>created_dt</arg>
<arg>--target-dir</arg>
<arg>${sqp_table1_dir}</arg>
<arg>--map-column-hive</arg>
<arg>ID=bigint,XML1=string,XML2=string,APP_PAYLOAD=string,created_dt=date,created_day=bigint</arg>
<arg>--query</arg>
<arg>"select * from schema1.table1 where $CONDITIONS AND trunc(created_dt) BETWEEN to_date('${load_start_date}','yyyy-mm-dd') AND to_date('${load_end_date}','yyyy-mm-dd')"</arg>
</sqoop>
<ok to="dly_load_wf_complete"/>
<error to="fail"/>
</action>