imported失败:从oracle数据库导入clob数据期间无法转换sql类型2005==>

5f0d552i  于 2021-06-04  发布在  Sqoop
关注(0)|答案(1)|浏览(467)

我正在尝试使用sqoop导入具有clob数据类型的oracle表的数据,但由于出现错误而失败 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>
3vpjnl9f

3vpjnl9f1#

最后,我用了一个附加条款 -D oraoop.disabled=true 在sqoop导入选项中。
下面的工作

<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>

相关问题