2016-03-28 34 views
1

我試圖使用sqoop導入包含CLOB數據類型的Oracle表數據,並且因錯誤Imported Failed: Cannot convert SQL type 2005而失敗。我正在使用Running Sqoop version: 1.4.5-cdh5.4.7導入失敗:在從Oracle數據庫導入CLOB數據期間無法轉換SQL類型2005 ==>

請幫我介紹一下如何導入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>  
+0

請提供更多的細節。例如。 [是否是直接模式](https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_literal_blob_literal_and_literal_clob_literal_columns)等。 – ThinkJet

+0

我正在使用oozie工作流程來執行此操作,並且提供了oozie工作流程的腳本。 –

回答

1

最後,在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> 
相關問題