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);
apache.sqoop包是否有任何问题?请帮助我。
答案 0 :(得分: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