-
Notifications
You must be signed in to change notification settings - Fork 224
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
[tis-flink-cdc-postgresql-plugin] java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.time.Instant #293
Comments
I used the following to fix the date conversion error:
But it throws a new exception:
通过查看flink docker 使用的kryo的版本为: <dependency>
<groupId>com.esotericsoftware.kryo</groupId>
<artifactId>kryo</artifactId>
<version>2.24.0</version>
</dependency> |
UPDATE
|
由于 testid 为 numeric 类型通过 postgresql JDBC接口 通过metadata获取得到为decimal类型,但是 precision与 scale 均为0 testid numeric NOT NULL, 导致在flink的内部类型为 decimal( 38,0 ) 在实例postgresql->mysql 场景中
最终在flink sql方式同步过程中的执行计划为: Source: 192.168.28.201:5432_tis
+- Process
+- test
+- [53]:TableSourceScan(table=[[*anonymous_datastream_source$14*]], fields=[testid, sxh, testmc, zjzl, zjzlmc, zjh, hjszss, dh, dz, testlx, testlxmc, yxbz, cjr, cjsj, zhxgr, zhxgsj, scr, scsj, bz])
+- [54]:DropUpdateBefore
+- [55]:Calc(select=[CAST(testid AS DECIMAL(10, 0)) AS testid, sxh, testmc, zjzl, zjzlmc, zjh, hjszss, dh, dz, testlx, testlxmc, yxbz, cjr, cjsj, zhxgr, zhxgsj, scr, scsj, bz])
+- [56]:ConstraintEnforcer[NotNullEnforcer(fields=[testid])]
+- [56]:Sink(table=[default_catalog.default_database.test], targetColumns=[[0],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17],[18]], fields=[testid, sxh, testmc, zjzl, zjzlmc, zjh, hjszss, dh, dz, testlx, testlxmc, yxbz, cjr, cjsj, zhxgr, zhxgsj, scr, scsj, bz]) 多了一个 |
Exception log
DDL
INSERT
UPDATE
The text was updated successfully, but these errors were encountered: