2012-09-05 42 views
1
Iam new in sqoop.Actual iam used sqoop import & export through command line arguments.But now iam trying to implment with java.I got compile time error when calling expTool.run(sqoopoptions) when using the org.apache.sqoop.SqoopOptions package.If i am trying to use cloudera package instead of apache sqoop package.there is no compile time execption.check the below code snippet 
SqoopTool expTool=new ExportTool(); 
    SqoopOptions options=new SqoopOptions(); 
    options.setConnectString("jdbc:mysql://localhost/sample_db"); 
    options.setUsername("hive"); 
    options.setPassword("hadoop"); 
    options.setExportDir("hdfs://localhost:7002/user/warehouse/output1/part-00000"); 
    options.setTableName("warehouse"); 
    options.setInputFieldsTerminatedBy(','); 
    expTool.run(options); 

是否有任何問題與implmentation包apache.sqoop?。請幫助我。com.cloudera.sqoop.SqoopOptions vs org.apache.sqoop.SqoopOptions有什麼區別嗎?

回答

1

Sqoop最初是在Cloudera github上公開開發的,因此所有代碼都存儲在com.cloudera.sqoop命名空間中。在Apache Software Foundation中進行孵化期間,所有功能都已移至org.apache.sqoop命名空間。爲了保持向後兼容性,Sqoop沒有刪除com.cloudera.sqoop命名空間,但建議用戶使用org.apache.sqoop中的代碼。有關命名空間遷移的詳細信息可以在Sqoop wiki上找到[1]。

鏈接:

1:https://cwiki.apache.org/confluence/display/SQOOP/Namespace+Migration

相關問題