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

Unexpected exception with an optional Postgis.Geometry column

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 0.9.2.Final, 0.10.0.Beta2
    • postgresql-connector
    • None

    Description

      Assuming you have got this king of schema :

      CREATE EXTENSION postgis;
      CREATE TABLE t_coordonnees
      (
        id SERIAL NOT NULL PRIMARY KEY,
        wgs84 geometry(Geometry,4326)
      );
      

      Then io.debezium.connector.postgresql.RecordsSnapshotProducer sends an unexpected exception

      io.debezium.connector.postgresql.RecordsSnapshotProducer - unexpected exception
      org.apache.kafka.connect.errors.SchemaBuilderException: Invalid SchemaBuilder call: optional has already been set.
      	at org.apache.kafka.connect.data.SchemaBuilder.checkNull(SchemaBuilder.java:406) ~[connect-api-0.10.2.1.jar:?]
      	at org.apache.kafka.connect.data.SchemaBuilder.optional(SchemaBuilder.java:98) ~[connect-api-0.10.2.1.jar:?]
      	at io.debezium.relational.TableSchemaBuilder.addField(TableSchemaBuilder.java:361) ~[debezium-core-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at io.debezium.relational.TableSchemaBuilder.lambda$create$0(TableSchemaBuilder.java:108) ~[debezium-core-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_191]
      	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) ~[?:1.8.0_191]
      	at io.debezium.relational.TableSchemaBuilder.create(TableSchemaBuilder.java:99) ~[debezium-core-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at io.debezium.relational.RelationalDatabaseSchema.buildAndRegisterSchema(RelationalDatabaseSchema.java:126) ~[debezium-core-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at io.debezium.connector.postgresql.PostgresSchema.refreshSchema(PostgresSchema.java:171) ~[debezium-connector-postgres-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4649) ~[?:1.8.0_191]
      	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) ~[?:1.8.0_191]
      	at io.debezium.connector.postgresql.PostgresSchema.refreshSchemas(PostgresSchema.java:162) ~[debezium-connector-postgres-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at io.debezium.connector.postgresql.PostgresSchema.refresh(PostgresSchema.java:95) ~[debezium-connector-postgres-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at io.debezium.connector.postgresql.RecordsSnapshotProducer.takeSnapshot(RecordsSnapshotProducer.java:189) ~[debezium-connector-postgres-0.10.0.Beta2.jar:0.10.0.Beta2]
      	at io.debezium.connector.postgresql.RecordsSnapshotProducer.lambda$start$0(RecordsSnapshotProducer.java:87) ~[debezium-connector-postgres-0.10.0.Beta2.jar:0.10.0.Beta2]
      
      

      Everything is working as expected if the type is not nullable :

      CREATE EXTENSION postgis;
      CREATE TABLE t_coordonnees
      (
        id SERIAL NOT NULL PRIMARY KEY,
        wgs84 geometry(Geometry,4326) NOT NULL
      );
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            willome Guillaume Rosauro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: