Skip to content

[BUG][Connector-V2][Jdbc] not support postgresql xml type  #5733

@jackyyyyyssss

Description

@jackyyyyyssss

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

if jdbc source have xml type not support

SeaTunnel Version

2.3.3

SeaTunnel Config

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

env {
  execution.parallelism = 1
  job.mode = "BATCH"
}

source{
    jdbc{
        url = "jdbc:postgresql://127.0.0.1:5432/mydb?loggerLevel=OFF"
        driver = "org.postgresql.Driver"
        user = "postgres"
        password = "root"
        query ="""select id,name from test"""
    }
}


sink {
  Jdbc {
    driver = org.postgresql.Driver
    url = "jdbc:postgresql://127.0.0.1:5432/mydb?loggerLevel=OFF&stringtype=unspecified"
    user = postgres
    password = root
    generate_sink_sql = true
    database = mydb
    table = public.test2
    primary_keys = ["id"]
  }
}

CREATE TABLE IF NOT EXISTS public.test
(
    id bigint NOT NULL,
    name xml,
    xmlarray xml[],
    CONSTRAINT test_pkey PRIMARY KEY (id)
)

Running Command

./seatunnel.sh

Error Exception

[INFO] 2023-10-09 17:33:57.983 +0800 - -> 2023-10-09 17:33:57,225 WARN org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSource - get row type info exception
org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[COMMON-05], ErrorDescription:[Unsupported operation] - Doesn't support Postgres type 'xml' yet
at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.psql.PostgresTypeMapper.mapping(PostgresTypeMapper.java:168) ~[connector-jdbc-2.3.3.jar:2.3.3]
at org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSource.initTableField(JdbcSource.java:178) [connector-jdbc-2.3.3.jar:2.3.3]
at org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSource.prepare(JdbcSource.java:108) [connector-jdbc-2.3.3.jar:2.3.3]
at org.apache.seatunnel.engine.core.parse.JobConfigParser.parseSource(JobConfigParser.java:85) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parseSource(MultipleTableJobConfigParser.java:317) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parse(MultipleTableJobConfigParser.java:179) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.engine.core.job.AbstractJobEnvironment.getLogicalDag(AbstractJobEnvironment.java:109) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.engine.client.job.JobExecutionEnvironment.execute(JobExecutionEnvironment.java:73) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:143) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) [seatunnel-starter.jar:2.3.3]
at org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:34) [seatunnel-starter.jar:2.3.3]
2023-10-09 17:33:57,232 INFO com.hazelcast.core.LifecycleService - hz.client_1 [seatunnel] [5.1] HazelcastClient 5.1 (20220228 - 21f20e7) is SHUTTING_DOWN

Zeta or Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions