Kafka Connect and Oracle data types
The Kafka Connect JDBC Connector by default does not cope so well with:
NUMBERcolumns with no defined precision/scale. You may end up with apparent junk (bytes) in the output, or just errors.TIMESTAMP WITH LOCAL TIME ZONE. ThrowsJDBC type -102 not currently supportedwarning in the log.
Read more about NUMBER data type in the Oracle docs.
tl;dr : How do I make it work?
There are several options:
New in Confluent Platform 4.1.1 : numeric.mapping
- In the connector configuration, set
"numeric.mapping":"best_fit" - New in Confluent Platform 4.1.1 (Doc)
Avoid the problem in the first place
- Change the DDL of the source object. For example:
- refine the
NUMBER’s precision and scale - Use a
TIMESTAMPtype that is supported
- refine the
CAST the datatypes in the query
-
Pull from the object directly, and use
queryin the JDBC connector (instead oftable.whitelist)—and cast the columns appropriately: