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

DDL with Oracle sequence as default for primary key fails schema generation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.8.0.Alpha2
    • 1.7.0.Final
    • oracle-connector
    • None
    • False
    • False
    • Hide
      1. Create Oracle sequence and a table with Oracle sequence as default for primary key (see SQL attached)
      2. Start Kafka Connect with Debezium Oracle connector installed
      3. ConfigureĀ Debezium Oracle connector (XStream) to watch the table from step 1
      4. Insert a record into the table (see the SQL attached)
        ==> Connector's task fails (see the log attached)
      Show
      Create Oracle sequence and a table with Oracle sequence as default for primary key (see SQL attached) Start Kafka Connect with Debezium Oracle connector installed ConfigureĀ Debezium Oracle connector (XStream) to watch the table from step 1 Insert a record into the table (see the SQL attached) ==> Connector's task fails (see the log attached)

      DDL with Oracle 19c sequence as default for primary key fails schema generation and stops the Oracle Connector (XStreams). Below is the error. Full log attached.

      kafka-connect      | [2021-10-27 19:35:54,600] DEBUG [source-oracle-dbz-xstream-00|task-0] Mapping table 'ORCLPDB1.PRISM_JOB.JOB' to schemas under 'asgard.PRISM_JOB.JOB' (io.debezium.relational.TableSchemaBuilder:103)
      kafka-connect      | [2021-10-27 19:35:54,601] DEBUG [source-oracle-dbz-xstream-00|task-0] Building schema for column ID of type 2 named NUMBER with constraints (18,Optional[0]) (io.debezium.connector.oracle.OracleValueConverters:116)
      kafka-connect      | [2021-10-27 19:35:54,602] ERROR [source-oracle-dbz-xstream-00|task-0] Producer failure (io.debezium.pipeline.ErrorHandler:31)
      kafka-connect      | org.apache.kafka.connect.errors.SchemaBuilderException: Invalid default value
      kafka-connect      |    at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:131)
      kafka-connect      |    at io.debezium.relational.TableSchemaBuilder.addField(TableSchemaBuilder.java:374)
      kafka-connect      |    at io.debezium.relational.TableSchemaBuilder.lambda$create$2(TableSchemaBuilder.java:119)
      kafka-connect      |    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
      kafka-connect      |    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      kafka-connect      |    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
      kafka-connect      |    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
      kafka-connect      |    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
      kafka-connect      |    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
      kafka-connect      |    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
      kafka-connect      |    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      kafka-connect      |    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
      kafka-connect      |    at io.debezium.relational.TableSchemaBuilder.create(TableSchemaBuilder.java:117)
      kafka-connect      |    at io.debezium.relational.RelationalDatabaseSchema.buildAndRegisterSchema(RelationalDatabaseSchema.java:135)
      kafka-connect      |    at io.debezium.connector.oracle.OracleDatabaseSchema.lambda$applySchemaChange$0(OracleDatabaseSchema.java:73)
      kafka-connect      |    at java.lang.Iterable.forEach(Iterable.java:75)
      kafka-connect      |    at io.debezium.connector.oracle.OracleDatabaseSchema.applySchemaChange(OracleDatabaseSchema.java:72)
      kafka-connect      |    at io.debezium.pipeline.EventDispatcher$SchemaChangeEventReceiver.schemaChangeEvent(EventDispatcher.java:539)
      kafka-connect      |    at io.debezium.connector.oracle.OracleSchemaChangeEventEmitter.emitSchemaChangeEvent(OracleSchemaChangeEventEmitter.java:119)
      kafka-connect      |    at io.debezium.pipeline.EventDispatcher.dispatchSchemaChangeEvent(EventDispatcher.java:305)
      ...
      kafka-connect      | Caused by: org.apache.kafka.connect.errors.DataException: Invalid Java object for schema type INT64: class java.lang.String for field: "null"
      kafka-connect      |    at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:240)
      kafka-connect      |    at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:213)
      kafka-connect      |    at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:129)
      kafka-connect      |    ... 33 more
      

              ccranfor@redhat.com Chris Cranford
              stsymbal Sergii Tsymbal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: