Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickhouse字段类型为date,kafka字段为null,报错 #79

Open
zhbdesign opened this issue May 26, 2023 · 10 comments
Open

clickhouse字段类型为date,kafka字段为null,报错 #79

zhbdesign opened this issue May 26, 2023 · 10 comments

Comments

@zhbdesign
Copy link

clickhouse字段类型为date,kafka字段为null,报错,数据无法插入

@itinycheng
Copy link
Owner

异常内容是?

@zhbdesign
Copy link
Author

有交流群可以加吗😜

@zhbdesign
Copy link
Author

flinksql中,kafka连接器和clickhouse 连接器定义的这两个字段都是string类型,因为毫秒那个不太规范,用的是冒号,不用字符串会异常,
如果两个字段都有值的情况下没问题

@itinycheng
Copy link
Owner

itinycheng commented May 26, 2023

flinksql中,kafka连接器和clickhouse 连接器定义的这两个字段都是string类型,因为毫秒那个不太规范,用的是冒号,不用字符串会异常, 如果两个字段都有值的情况下没问题

String和Date是两个类型,本身这样就做就不合理;
clickhouse-jdbc会将Date转为yyyy-MM-dd的格式然后发送到clickhouse server端,如果是yyyy-MM-dd的字符串应该是可以写成功的(这样做只是绕过,而不是解决问题);

@itinycheng
Copy link
Owner

有交流群可以加吗😜

没群;不过这个插件并不复杂,可以本地断点测试下;

@zhbdesign
Copy link
Author

我确实没有测试正常毫秒格式的数据,然后有null的是否正常

@zhbdesign
Copy link
Author

这个可以先删除吗,我们有一些要脱敏,但是可能不够彻底

@zhbdesign
Copy link
Author

图片删除就行

@zhbdesign
Copy link
Author

你说的应该是正确的,因为第一个时间都是非空的,我后边那个有空的字段在ck中用字符串也不行,要把第一个也用字符串才可以正常导入数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants