且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

导入失败:无法转换SQL类型2005 ==>从Oracle数据库导入CLOB数据期间

更新时间:2021-12-10 08:29:52

最后,它对我有用,在sqoop导入选项中添加了附加子句-D oraoop.disabled=true.

Finally it worked for me with an additional clause -D oraoop.disabled=true in sqoop import option.

以下方法有效

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