Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7079

Oracle property column.truncate.to.length.chars does not support length zero

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.7.0.Beta2
    • 2.3.0.Final
    • core-library
    • None
    • Important

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      Link to the question raised on DBZ google group. 

      https://groups.google.com/g/debezium/c/aB_K7UuAO1E/m/8f0xHGvsAAAJ 

      What Debezium connector do you use and what version?

      Oracle connector 

      debezium     connect:2.3.0.Final.2
      debeziumui    debezium-ui:2.1.2.Final

      What is the connector configuration?

      {
          "name":"capture_sctest10_fin_ora",
          "config":

      {     "connector.class": "io.debezium.connector.oracle.OracleConnector",         "database.hostname": <host>,         "database.port": "1522",         "database.user": <user>,         "database.password": <password>,         "database.dbname": <dbname>,     "tasks.max": "1",     "snapshot.max.threads": "4",     "table.include.list": "<schema>.<table_name>",     "topic.prefix": "finora_sc10",     "column.truncate.to.0.chars": "<schema>.<table_name>.<column_name>",     "transforms": "route",     "transforms.route.type": "org.apache.kafka.connect.transforms.RegexRouter",     "transforms.route.regex": "([^.]+)\\.([^.]+)\\.([^.]+)",     "transforms.route.replacement": "$1.$3",     "decimal.handling.mode": "double",     "poll.interval.ms": "30",     "time.precision.mode": "connect",     "schema.include.list": <schema>,     "schema.history.internal.kafka.bootstrap.servers": "kafka-0.kafka.debezium-poc.svc.cluster.local:9092",     "schema.history.internal.kafka.topic": "schema-changes.finora_sc10",     "schema.history.internal.store.only.captured.tables.ddl": "true",     "key.converter": "io.confluent.connect.avro.AvroConverter",     "value.converter": "io.confluent.connect.avro.AvroConverter",     "key.converter.schema.registry.url": "http://schema-registry-0.schema-registry.debezium-poc.svc.cluster.local:8081",     "value.converter.schema.registry.url": "http://schema-registry-0.schema-registry.debezium-poc.svc.cluster.local:8081",     "exactly.once.support": "requested"   }

      }

      What is the captured database version and mode of depoyment?

      Oracle - Version 18.3.0.0.0 -  on-premises 

      What behaviour do you expect?

      The documentation of the oracle connector property -column.truncate.to.length.chars
      states - 
      ''Set length to 0 (zero) to replace data in the specified columns with an empty string.'
      https://debezium.io/documentation/reference/2.4/connectors/oracle.html#oracle-property-column-truncate-to-length-chars 
       
      So I expect to see the same behavior. i.e. The column should be blanked out. 

      What behaviour do you see?

      when using column.truncate.to.0.chars throws error. I even tried - 
       column.truncate.to.zero.chars where it does not truncate any char from the input string. 
      So wondering if emptying a column data is supported. 
       "java.lang.IllegalArgumentException: Maximum length must be positive\n\

      Do you see the same behaviour using the latest relesead Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      Not tried yet with latest version yet. 

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

       "java.lang.IllegalArgumentException: Maximum length must be positive\n\tat io.debezium.relational.mapping.TruncateStrings.<init>(TruncateStrings.java:31)\n\tat io.debezium.relational.mapping.ColumnMappers$Builder.truncateStrings(ColumnMappers.java:178)\n\tat io.debezium.config.Configuration.lambda$forEachMatchingFieldName$29(Configuration.java:2181)\n\tat java.base/java.util.HashMap.forEach(HashMap.java:1337)\n\tat io.debezium.config.Configuration.forEachMatchingFieldName(Configuration.java:2175)\n\tat io.debezium.config.Configuration.forEachMatchingFieldNameWithInteger(Configuration.java:2059)\n\tat io.debezium.config.Configuration.forEachMatchingFieldNameWithInteger(Configuration.java:2023)\n\tat io.debezium.relational.mapping.ColumnMappers.create(ColumnMappers.java:56)\n\tat io.debezium.relational.RelationalDatabaseSchema.<init>(RelationalDatabaseSchema.java:50)\n\tat io.debezium.relational.HistorizedRelationalDatabaseSchema.<init>(HistorizedRelationalDatabaseSchema.java:47)\n\tat io.debezium.connector.oracle.OracleDatabaseSchema.<init>(OracleDatabaseSchema.java:51)\n\tat io.debezium.connector.oracle.OracleConnectorTask.start(OracleConnectorTask.java:74)\n\tat io.debezium.connector.common.BaseSourceTask.startIfNeededAndPossible(BaseSourceTask.java:260)\n\tat io.debezium.connector.common.BaseSourceTask.poll(BaseSourceTask.java:169)\n\tat org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.poll(AbstractWorkerSourceTask.java:457)\n\tat org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.execute(AbstractWorkerSourceTask.java:351)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:202)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:257)\n\tat org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.run(AbstractWorkerSourceTask.java:75)\n\tat org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:177)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\n" 

       

              Unassigned Unassigned
              prasads@red Prasad S (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: