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

Debezium 1.9.2 cannot capture field that is date type of postgres

    XMLWordPrintable

Details

    • False
    • None
    • False
    • Hide

      Step 1. create table so.so_header in postgres.

      CREATE TABLE so.so_header (
      	id varchar(36) NOT NULL,
      	eori bpchar(1) NOT NULL,
      	so_type varchar(50) NOT NULL,
      	source_code varchar(200) NULL,
      	source_header_id varchar(300) NULL,
      	source_type varchar(50) NULL,
      	so_code varchar(50) NOT NULL,
      	sale_type varchar(50) NULL,
      	corp_oid varchar(36) NULL,
      	bu_oid varchar(36) NULL,
      	dept_oid varchar(36) NULL,
      	perf_dept_oid varchar(50) NULL,
      	rec_cus_code varchar(50) NULL,
      	rec_cus_name varchar(300) NULL,
      	bill_cus_code varchar(50) NULL,
      	bill_cus_name varchar(300) NULL,
      	final_cus_code varchar(50) NULL,
      	final_cus_name varchar(300) NULL,
      	om_user varchar(36) NULL,
      	om_user_name varchar(50) NULL,
      	sales_user varchar(36) NULL,
      	sales_user_name varchar(50) NULL,
      	is_tax bpchar(1) NULL,
      	exchange_rate numeric(20, 6) NULL DEFAULT 0,
      	currency varchar(50) NULL,
      	is_occupy_deposit bpchar(1) NULL DEFAULT 0,
      	deposit_ratio numeric(20, 6) NULL,
      	total_amount numeric(20, 6) NULL DEFAULT 0,
      	total_rbt_amount numeric(20, 6) NULL DEFAULT 0,
      	header_status varchar(50) NULL,
      	settlement_type varchar(50) NULL,
      	trade_term varchar(50) NULL,
      	payment_method varchar(50) NULL,
      	payment_method_desc varchar(300) NULL,
      	order_date date NULL,
      	funds_platform_fee_rate numeric(20, 6) NULL DEFAULT 0,
      	funds_platform_fee_amount numeric(20, 6) NULL DEFAULT 0,
      	is_auto_billing bpchar(1) NULL,
      	co_id varchar(32) NULL,
      	co_no varchar(30) NULL,
      	submit_date timestamp NULL,
      	approved_user varchar(36) NULL,
      	approved_date timestamp NULL,
      	approved_remark varchar(4000) NULL,
      	remark varchar(1000) NULL,
      	"version" int4 NULL DEFAULT 0,
      	is_deleted bpchar(1) NULL,
      	crt_user varchar(36) NOT NULL,
      	crt_name varchar(50) NOT NULL,
      	crt_time timestamp NOT NULL,
      	crt_host varchar(50) NOT NULL,
      	upd_user varchar(36) NULL,
      	upd_name varchar(50) NULL,
      	upd_host varchar(50) NULL,
      	upd_time timestamp NULL,
      	sell_to_region_code varchar(50) NULL,
      	trace_id varchar(36) NULL DEFAULT NULL::character varying,
      	business_type varchar(10) NULL,
      	departure_place varchar(300) NULL DEFAULT NULL::character varying,
      	validation_result jsonb NULL,
      	self_exchange_rate numeric(20, 6) NULL,
      	corp_export bpchar(1) NULL,
      	is_rbt bpchar(1) NULL,
      	payment_deadline timestamp NULL,
      	sale_sub_type varchar(50) NULL,
      	source_req varchar(50) NULL,
      	first_approved_date timestamp NULL,
      	CONSTRAINT so_header_pkey PRIMARY KEY (id)
      );

      Step 2. update records.

      update so.so_header set order_date='2021-07-12' where id = '0123eca24ebd40ad88741fa67249beb4';  

      Step 3. debezium report error.

      Caused by: java.time.format.DateTimeParseException: Text '2021-07-12' could not be parsed at index 10
      at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
      at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1874)
      at io.debezium.connector.postgresql.connection.wal2json.DateTimeFormat$ISODateTimeFormat.lambda$timestampToInstant$3(DateTimeFormat.java:160)
      at io.debezium.connector.postgresql.connection.wal2json.DateTimeFormat$ISODateTimeFormat.format(DateTimeFormat.java:150)
      ... 29 more 

      connect.log

      Show
      Step 1. create table so.so_header in postgres. CREATE TABLE so.so_header ( id varchar(36) NOT NULL, eori bpchar(1) NOT NULL, so_type varchar(50) NOT NULL, source_code varchar(200) NULL, source_header_id varchar(300) NULL, source_type varchar(50) NULL, so_code varchar(50) NOT NULL, sale_type varchar(50) NULL, corp_oid varchar(36) NULL, bu_oid varchar(36) NULL, dept_oid varchar(36) NULL, perf_dept_oid varchar(50) NULL, rec_cus_code varchar(50) NULL, rec_cus_name varchar(300) NULL, bill_cus_code varchar(50) NULL, bill_cus_name varchar(300) NULL, final_cus_code varchar(50) NULL, final_cus_name varchar(300) NULL, om_user varchar(36) NULL, om_user_name varchar(50) NULL, sales_user varchar(36) NULL, sales_user_name varchar(50) NULL, is_tax bpchar(1) NULL, exchange_rate numeric(20, 6) NULL DEFAULT 0, currency varchar(50) NULL, is_occupy_deposit bpchar(1) NULL DEFAULT 0, deposit_ratio numeric(20, 6) NULL, total_amount numeric(20, 6) NULL DEFAULT 0, total_rbt_amount numeric(20, 6) NULL DEFAULT 0, header_status varchar(50) NULL, settlement_type varchar(50) NULL, trade_term varchar(50) NULL, payment_method varchar(50) NULL, payment_method_desc varchar(300) NULL, order_date date NULL, funds_platform_fee_rate numeric(20, 6) NULL DEFAULT 0, funds_platform_fee_amount numeric(20, 6) NULL DEFAULT 0, is_auto_billing bpchar(1) NULL, co_id varchar(32) NULL, co_no varchar(30) NULL, submit_date timestamp NULL, approved_user varchar(36) NULL, approved_date timestamp NULL, approved_remark varchar(4000) NULL, remark varchar(1000) NULL, "version" int4 NULL DEFAULT 0, is_deleted bpchar(1) NULL, crt_user varchar(36) NOT NULL, crt_name varchar(50) NOT NULL, crt_time timestamp NOT NULL, crt_host varchar(50) NOT NULL, upd_user varchar(36) NULL, upd_name varchar(50) NULL, upd_host varchar(50) NULL, upd_time timestamp NULL, sell_to_region_code varchar(50) NULL, trace_id varchar(36) NULL DEFAULT NULL::character varying, business_type varchar(10) NULL, departure_place varchar(300) NULL DEFAULT NULL::character varying, validation_result jsonb NULL, self_exchange_rate numeric(20, 6) NULL, corp_export bpchar(1) NULL, is_rbt bpchar(1) NULL, payment_deadline timestamp NULL, sale_sub_type varchar(50) NULL, source_req varchar(50) NULL, first_approved_date timestamp NULL, CONSTRAINT so_header_pkey PRIMARY KEY (id) ); Step 2. update records. update so.so_header set order_date= '2021-07-12' where id = '0123eca24ebd40ad88741fa67249beb4' ; Step 3. debezium report error. Caused by: java.time.format.DateTimeParseException: Text '2021-07-12' could not be parsed at index 10 at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046) at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1874) at io.debezium.connector.postgresql.connection.wal2json.DateTimeFormat$ISODateTimeFormat.lambda$timestampToInstant$3(DateTimeFormat.java:160) at io.debezium.connector.postgresql.connection.wal2json.DateTimeFormat$ISODateTimeFormat.format(DateTimeFormat.java:150) ... 29 more connect.log

    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?

      1.9.2.Final

      What is the connector configuration?

       

      {                                                                                                                   "connector.class": "io.debezium.connector.postgresql.PostgresConnector",                                                    "slot.name": "slot_tmp_pgtest_biz",                                                                                         "tasks.max": "1",                                                                                                           "database.history.kafka.topic": "dbhistory_pgtest_biz",                                                                     "publication.name": "pub_pgtest_biz",                                                                                       "tombstones.on.delete": "true",                                                                                             "decimal.handling.mode": "double",                                                                                          "value.converter": "io.confluent.connect.avro.AvroConverter",                                                               "key.converter": "io.confluent.connect.avro.AvroConverter",                                                                 "database.tcpKeepAlive": "true",                                                                                            "database.user": "xxx",                                                                                                   "database.dbname": "pgtest_biz",                                                                                            "database.history.kafka.bootstrap.servers": "t-edi-data-001:9092,t-edi-data-002:9092,t-edi-data-003:9092",                  
      "time.precision.mode": "connect",                                                                                           "connection.attempts": "1000",                                                                                              "database.server.name": "pgtest_biz",                                                                                       "heartbeat.interval.ms": "5000",                                                                                            "database.port": "5432",                                                                                                    "plugin.name": "pgoutput",                                                                                                  "value.converter.schema.registry.url": "http://t-edi-data-001:8081,http://t-edi-data-002:8081,http://t-edi-data-003:8081",                                                                                                                              "database.hostname": "xxxx.xx.xx.xx",                                                                                "database.password": "xxxxx",                                                                                          
      "name": "source-tmp_pgtest_biz-connector",                                                                                  "table.include.list": "so.so_header",                                                                                       "key.converter.schema.registry.url": "http://t-edi-data-001:8081,http://t-edi-data-002:8081,http://t-edi-data-003:8081",    
      "snapshot.mode": "never"                                                                                                  } 

       

       

      What is the captured database version and mode of depoyment?

      PostgreSQL 11.5

      What behaviour do you expect?

      debezium can capture field of type date of postgres.

      What behaviour do you see?

      debezium cannot capure field of type date of postgres, and prompt below error.

      Caused by: java.time.format.DateTimeParseException: Text '2021-07-12' could not be parsed at index 10
      at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
      at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1874)
      at io.debezium.connector.postgresql.connection.wal2json.DateTimeFormat$ISODateTimeFormat.lambda$timestampToInstant$3(DateTimeFormat.java:160)
      at io.debezium.connector.postgresql.connection.wal2json.DateTimeFormat$ISODateTimeFormat.format(DateTimeFormat.java:150)
      ... 29 more

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

      I have tested in 1.8.1, 1.9.2 and 2.0 Alpha, the issue still exist.

      Do you have the connector logs, ideally from start till finish?

      Please see the attachment.

      How to reproduce the issue using our tutorial deployment?

       

       

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      <Your answer>

      Implementation ideas (optional)

      <Your answer>

      Attachments

        Activity

          People

            Unassigned Unassigned
            chnzhoujun Jun Zhou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: