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

Issue in ReselectColumnsPostProcessor when field's schema type is BYTES

XMLWordPrintable

      I am using Debezium Postgress Connector 3.2.0.Final for ingesting table changes to Kafka for further processing. Since my table had one of the column of type BINARY which contains data around 6 kb to 10 kb. I used 'ReselectColumnsPostProcessor' to handle TOAST situations as documented in Debezium pages.

      I noticed 'ReselectColumnsPostProcessor' worked fine for TEXT or String type column. But it failed for columns of type BYTES or BINARY.

      I debugged the code and the logs and found that below lines of code fails to compare data equality,

          private boolean isUnavailableValueHolder(Schema schema, Object value) {
              switch (schema.type()) {
                  case BYTES:
                      return unavailableValuePlaceholderBytes.equals(value);
      

      because, at this point unavailableValuePlaceholderBytes is of type 'java.nio.HeapByteBuffer', whereas value is of type 'byte[]'.

      "A byte buffer is not equal to any other type of object."

       

      This code needs a fix so that the postprocessor can be used on columns of BINARY type.

              Unassigned Unassigned
              spsheni Shyama Praveena S
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: