Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle io.debezium.time.ZonedTimestamp schema name #1361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DmitriyBrashevets
Copy link

@DmitriyBrashevets DmitriyBrashevets commented Sep 8, 2023

Problem

The record from io.debezium.connector.postgresql.PostgresConnector source connector which contains the timestamp with timezone type in Postgres has the type STRING and name io.debezium.time.ZonedTimestamp in schema.
The io.debezium.time.ZonedTimestamp logical name is not anyhow supported by the JdbcSinkConnector

Record example:

{
  "schema": {
    "type": "struct",
    "fields": [
      {
        "type": "struct",
        "fields": [
          ...
          {
            "type": "string",
            "optional": true,
            "name": "io.debezium.time.ZonedTimestamp",
            "version": 1,
            "field": "from_date"
          },
          ...
        ],
        "optional": true,
        "name": "....Value",
        "field": "before"
      },
      {
        "type": "struct",
        "fields": [
          ...
          {
            "type": "string",
            "optional": true,
            "name": "io.debezium.time.ZonedTimestamp",
            "version": 1,
            "field": "from_date"
          },
          ...
        ],
        "optional": true,
        "name": "....Value",
        "field": "after"
      },
      {
        "type": "struct",
        "fields": [
          {
            "type": "string",
            "optional": false,
            "field": "version"
          },
          {
            "type": "string",
            "optional": false,
            "field": "connector"
          },
          {
            "type": "string",
            "optional": false,
            "field": "name"
          },
          {
            "type": "int64",
            "optional": false,
            "field": "ts_ms"
          },
          {
            "type": "string",
            "optional": true,
            "name": "io.debezium.data.Enum",
            "version": 1,
            "parameters": {
              "allowed": "true,last,false,incremental"
            },
            "default": "false",
            "field": "snapshot"
          },
          {
            "type": "string",
            "optional": false,
            "field": "db"
          },
          {
            "type": "string",
            "optional": true,
            "field": "sequence"
          },
          {
            "type": "string",
            "optional": false,
            "field": "schema"
          },
          {
            "type": "string",
            "optional": false,
            "field": "table"
          },
          {
            "type": "int64",
            "optional": true,
            "field": "txId"
          },
          {
            "type": "int64",
            "optional": true,
            "field": "lsn"
          },
          {
            "type": "int64",
            "optional": true,
            "field": "xmin"
          }
        ],
        "optional": false,
        "name": "io.debezium.connector.postgresql.Source",
        "field": "source"
      }
    ],
    "optional": false,
    "name": "..."
  },
  "payload": {
    "before": null,
    "after": {
      ...
      "from_date": "2023-09-03T21:00:00Z",
      ...
    },
    "source": {
      "version": "1.9.7.Final",
      "connector": "postgresql",
      ...
    },
    "op": "c",
    ...
  }
}

Solution

Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

@DmitriyBrashevets DmitriyBrashevets requested a review from a team as a code owner September 8, 2023 09:39
@cla-assistant
Copy link

cla-assistant bot commented Sep 8, 2023

CLA assistant check
All committers have signed the CLA.

@DmitriyBrashevets DmitriyBrashevets force-pushed the feature/support-postgres-timestampz-type branch from f4c0286 to b9ee430 Compare September 8, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant