Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of problems encountered in sqoop2 1.99.6 and source code modification

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1. When the cardinality of PartitionColumn is 1 (as shown in the following figure). Will report an error.

The error is as shown in the following picture

The source code is as follows

\ sqoop-1.99.6-bin-hadoop200\ connector\ connector-generic-jdbc\ src\ main\ java\ org\ apache\ sqoop\ connector\ jdbc\ GenericJdbcPartitioner.java

Change the source code to

Can

The parameter Null value allowed for the partition column: false in 2.Job will not report an error even if partition column has null, so the record for null is imported into HDFS.

Conclusion: it is not a problem. When this parameter is false, the map of pid is null will not be de-derived, but only when it is true, so it is correct not to report an error.

3. The problem of date and time. The specific modification method is as follows.

E:\ IdeaProject\ sqoop-1.99.6-bin-hadoop200\ connector\ connector-generic-jdbc\ src\ main\ java\ org\ apache\ sqoop\ connector\ jdbc\ GenericJdbcExtractor.java

The time type in 4.oracle will report an error when doing pid.

If (JDBC_DRIVER_ORACLE.equals (jdbcDriver)) {

/ / if it is oracle, do special treatment.

Conditions.append ("to_timestamp (\'") .append (sdf.format ((java.util.Date) lowerBound)) .append ("\', 'yyyy-mm-dd hh34:mi:ss.ff')")

Conditions.append ("

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report