I am going to face this problem with debezium eventually, but I really hope someone here can help me with decoding the NUMBER type from Oracle, which I am getting with a JDBC connector onto Kafka as bytes and I am having a hard time decoding it. I have tried help from chat gpt but it is making me go in circles. I am using Python and C# to dedode it without any succes. So I am not sure what I am missing.
Here is my scenario.
Oracle column datatype:
MY_FACTOR NUMBER
When selecting the the column value in Oracle select query:
SELECT MY_FACTOR FROM MY_SCHEMA.MY_CALC_RESULTS;
Result:
MY_FACTOR: 1
# My JDBC connector settings
$connectorJson = @"
{
"name": "oracle-calc-connector",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"tasks.max": "1",
"connection.url": "jdbc:oracle:thin:@//oracle-db:1521/FREEPDB1",
"connection.user": "MYUSER",
"connection.password": "mypassword",
"table.types": "TABLE",
"table.include.list": "MY_SCHEMA.MY_CALC_RESULTS",
"mode": "timestamp+incrementing",
"timestamp.columns.mapping": "MY_SCHEMA.MY_CALC_RESULTS:[DATA_LOAD_TS]",
"incrementing.column.mapping": "MY_SCHEMA.MY_CALC_RESULTS:PORTFOLIO_RESULTS_KEY",
"db.timezone": "UTC",
"poll.interval.ms": "5000",
"table.poll.interval.ms": "5000",
"numeric.mapping": "precision_only", # I have also tried with ‘none’ and ‘best_fit’ without any success
"validate.non.null": "false",
"topic.prefix": "oracle.calc.",
"batch.max.rows": "10000",
"producer.override.compression.type": "snappy"
}
}
"@
Kafka topic schema in the topic payload:
{
"type": "bytes",
"optional": true,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "127",
"connect.decimal.precision": "0"
},
"field": "MY_FACTOR"
},
Value of MY_FACTOR in the topic payload:
"MY_FACTOR": "OxdP6jOQnr/o+UfE4q0zr5p7lMvK0Fh9N+fohbLmyY9Nt9u5ZoAAAAAAAAAAAAAAAAAAAAA=",
How do I decode the encoded value of MY_FACTOR 'OxdP6jOQnr/o+UfE4q0zr5p7lMvK0Fh9N+fohbLmyY9Nt9u5ZoAAAAAAAAAAAAAAAAAAAAA='? as it comes out in bytes? Somewhere my value 1 is in there.
I have tried with C# and Python, but I don't know how to get the value out.
I get NULL value out or something very far from 1.
Can someone help?
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/debezium/bdbf2504-ab9e-4aab-99e2-b16b6e0c20b0n%40googlegroups.com.