Sqoop 提示The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception',

小灰灰 2023-10-18 21:14 126阅读 0赞

错误信息:The connection property ‘zeroDateTimeBehavior’ only accepts values of the form: ‘exception’, ‘round’ or ‘convertToNull’. The value ‘convertToNull ‘ is not in this set.

问题产生原因:Java 功能代码:通过Sqoop-1.4.7实现MySQL8 数据导入Hive-2.3.5 中

错误配置: “—connect”,”jdbc:mysql://192.168.60.206:3306/test?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true”,

正确配置: “—connect”,”jdbc:mysql://192.168.60.206:3306/test?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull”,

从上面代码可以看出遗漏了zeroDateTimeBehavior 属性值

zeroDateTimeBehavior 可以接收的属性值如下:

默认是 exception,抛出异常

round 是返回:0001-01-01 00:00:00.0

convertToNull 就是转换为 null

发表评论

表情:
评论列表 (有 0 条评论,126人围观)

还没有评论,来说两句吧...

相关阅读