Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7688

Allow byte array class for Decimal Logical Types to fix Debezium Issues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.1.1
    • None
    • connect
    • None

    Description

      Decimal Logical Type fields are failing with Kafka Connect sink tasks and showing this error:

      Invalid Java object for schema type BYTES: class [B for field: "null"

      There is an issue tracker for the problem here in the Confluent Schema Registry tracker (it's all related):  https://github.com/confluentinc/schema-registry/issues/833

      I've created a fix for this issue and tested and verified it in our CF4 cluster here at Shutterstock.

      The issue boils down to the fact that Avro Decimal Logical types store values as a Byte Arrays. Debezium sets the Default Value as Base64 encoded Byte Arrays and record values as Big Integer Byte Arrays.    I'd like to submit a PR that changes the SCHEMA_TYPE_CLASSES hash map in org.apache.kafka.connect.data.ConnectSchema to allow Byte Arrays for Decimal fields. 

      I reached out to users@kafka.apache.org to ask for GitHub permissions but if there is somewhere else I need to reach out to please let me know.

      My GitHub user is TheGreatAbyss

      Thank You!

      Eric

      Attachments

        Activity

          People

            Unassigned Unassigned
            Eric Abis Eric C Abis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: