当前位置:网站首页>Sqoop imports tinyint type fields to boolean type

Sqoop imports tinyint type fields to boolean type

2022-04-23 20:12:00 My brother is not strong enough to fight

See the website :

Sqoop User Guide (v1.4.7)

The official website explains as follows :

Mysql in tinyint(1) when , After data import to HDFS when , This field will be converted to by default boolean data type , Loss of data content ( All become NULL).

Solution :

stay --connect After the parameter jdbc Add parameters to the connection :tinyInt1isBit=false

Be careful :

If you have more than one parameter , You need to use double quotes to enclose the entire parameter value

Such as :--connect "jdbc:mysql://ip:3306/db?serverTimezone=Asia/Shanghai&tinyInt1isBit=false"

result :

Yes flase convert to 0 了

 

版权声明
本文为[My brother is not strong enough to fight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210556213843.html