dinky
dinky copied to clipboard
[Bug] [CDCSOURCE] Oracle CDC could not deal with the date and number type properly
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
Flink 1.18.1 Dinky 1.02 Flink CDC 3.01
Oracle CDC could not transform the date and number type (especially for number(n) type), even u set the debezium.decimal.handling.mode to string
the exception looks like
number transform exception:
Caused by: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
date transform exception:
Caused by: java.lang.ClassCastException: class java.lang.long cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
What you expected to happen
The function initTypeConverterList in AbstractSinkBuilder did not work properly, not considered the oracle number and date type
How to reproduce
Create an oracle table which have date type and number(n) type's columns
run the script in dinky:
EXECUTE CDCSOURCE cdc_oracle WITH ( 'connector'='oracle-cdc', 'hostname'='...', 'port'='1521', 'username'='...', 'password'='...', 'database-name'='...', 'checkpoint'='3000', 'scan.startup.mode'='initial', 'parallelism'='1', 'table-name'='....', 'debezium.log.mining.strategy'='online_catalog', 'debezium.database.history.store.only.captured.tables.ddl'='true', 'debezium.database.tablename.case.insensitive'='false', 'debezium.log.mining.continuous.mine'='true', 'debezium.decimal.handling.mode'='string', 'sink.connector'='upsert-kafka', 'sink.properties.bootstrap.servers'='....', 'sink.topic'='#{tableName}', 'sink.key.format'='json', 'sink.value.format'='json' )
Anything else
No response
Version
1.0.2
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct