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

BigDecimal has mismatching scale value for given Decimal schema

    XMLWordPrintable

Details

    Description

      Oracle Number : Precision and scale

      Oracle allows the scale to be negative.

      If you specify a negative scale, Oracle Database rounds the actual data to the specified number of places to the left of the decimal point. For example, specifying (7,-2) means Oracle Database rounds to the nearest hundredths

      The `java.math.BigDecimal` scale must be between 0 and the precision 18 (both inclusive).

      It gives the following exception:

      cause: org.apache.kafka.connect.errors.DataException: BigDecimal has mismatching scale value for given Decimal schema
          at org.apache.kafka.connect.data.Decimal.fromLogical(Decimal.java:68)
          at org.apache.kafka.connect.json.JsonConverter$1.toJson(JsonConverter.java:157)
          at org.apache.kafka.connect.json.JsonConverter.convertToJson(JsonConverter.java:575)
          at org.apache.kafka.connect.json.JsonConverter.convertToJson(JsonConverter.java:662)
          at org.apache.kafka.connect.json.JsonConverter.convertToJson(JsonConverter.java:662)
          at org.apache.kafka.connect.json.JsonConverter.convertToJsonWithEnvelope(JsonConverter.java:550)
          at org.apache.kafka.connect.json.JsonConverter.fromConnectData(JsonConverter.java:304)

      Attachments

        Activity

          People

            ccranfor@redhat.com Chris Cranford
            zhenglc1990@126.com lincheng zheng (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: