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

Invalid Decimal schema: scale parameter not found

    XMLWordPrintable

Details

    Description

      When converting logical decimal types, the SQL Server (and likely other) connectors use BigDecimal.ZERO as a fallback for when no value is read for a column but the column is defined as non-nullable and with no default value: https://github.com/debezium/debezium/blob/a6e19d3988eb85c130d25ed7a18ddf33f880cb50/debezium-core/src/main/java/io/debezium/jdbc/JdbcValueConverters.java#L1024

       

      If the Connect schema for that column is a logical Decimal type with a non-zero scale, the fallback value will be incompatible with that schema and errors during serialization will likely be encountered since the scale of the value and the scale of its schema won't match: https://github.com/apache/kafka/blob/7c5c739b7f020ae40cc435a5f31f4c72bdfa1242/connect/api/src/main/java/org/apache/kafka/connect/data/Decimal.java#L79

       

      In order to handle this, the scale of the fallback value can be adjusted to match the scale of the schema for the column.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrise69 Chris Egerton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: