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

Debezium truncating micro/nanosecond part if it is all zeros with time zone

    XMLWordPrintable

Details

    • Low

    Description

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      Connector: PostgresqlConnector

      Version: debezium/connect-base:2.1.2.Final

      What is the connector configuration?

      time.precision.mode is `connect`

      .

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      PostgreSQL 14.6

      What behaviour do you see and expect?

      Database has field with type as timestamptz with timezone. When debezium produces the field's value to kafka, it truncates any leading zeros there might be in the nano/microsecond part. If the value contains only zeros in the nano/microsecond part, then the whole part is excluded.

      For ex.

      2022-10-27 14:51:45.522 +0530 --> 2022-10-27T09:21:45.522779Z

      2022-07-21 10:01:00.000 +0530 --> 2022-07-21T04:31:00Z

      This breaks the sink connectors which expect the date time type to be in the format yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'. 

      Expected was that the leading zeros should not get truncated, so that all the datetimes have consistent format.

      2022-10-27 14:51:45.522 +0530 --> 2022-10-27T09:21:45.522779Z

      2022-07-21 10:01:00.000 +0530 --> 2022-07-21T04:31:00.000000Z

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

      Yes.

      Attachments

        Issue Links

          Activity

            People

              ccranfor@redhat.com Chris Cranford
              alphonsetaylor Alphonse J (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: