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

Invalid Java object for schema with type FLOAT64: class java.lang.Float

XMLWordPrintable

    • False
    • None
    • False
    • Important

      Bug report

      Failed when set default value for MySQL data type Float unsigned

      What Debezium connector do you use and what version?

      v2.0.0

      What is the connector configuration?

      Run: MySqlFloatIT with extra column (float unsigned type)

      What is the captured database version and mode of depoyment?

      MySQL 5.7

      What behaviour do you expect?

      Not failed

      What behaviour do you see?

      Test-case failed

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

      Yes
      But it ok in version 1.9

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

      Caused by: org.apache.kafka.connect.errors.SchemaBuilderException: Invalid default value
          at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:131)
          at io.debezium.relational.TableSchemaBuilder.addField(TableSchemaBuilder.java:399)
          ... 30 common frames omitted
      Caused by: org.apache.kafka.connect.errors.DataException: Invalid Java object for schema with type FLOAT64: class java.lang.Float
          at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:242)
          at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:213)
          at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:129)
          ... 31 common frames omitted 

      How to reproduce the issue using our tutorial deployment?

      Add extra column to file float_test.sql ( add weight column)

      CREATE TABLE `DBZ3865` (
      `id` INT NOT NULL AUTO_INCREMENT,
      `f1` FLOAT DEFAULT 5.6,
      `f2` FLOAT(10, 2) DEFAULT NULL,
      `f3` FLOAT(35, 5) DEFAULT NULL,
      `f4_23` FLOAT(23) DEFAULT NULL,
      `f4_24` FLOAT(24) DEFAULT NULL,
      `f4_25` FLOAT(25) DEFAULT NULL,
      `weight` float unsigned DEFAULT '0',
      PRIMARY KEY (`ID`)
      ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
      INSERT INTO DBZ3865(f1, f2, f3, f4_23, f4_24, f4_25) VALUE (5.6, 5.61, 30.123456, 64.1, 64.1, 64.1);

      And run MysqlFloatIT

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

       

      Implementation ideas (optional)

       

              Unassigned Unassigned
              dinhman.it Nguyen Dinh Man (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: