Skip to content

[Bug] postgres-16-postgis geometry字段在CDC同步时会直接报错,无法被排除 #67485

Description

@fine-1

Search before asking

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

Version

4.1.3 lastest

What's Wrong?

我的pgsql数据库使用了postgis插件,该插件引入了新的数据类型,其中我有一些表使用了geomtry这一几何类型字段,该字段在cdc同步时会先报错类型不支持,从而导致“exclude_columns”排除参数无法生效。

以下排除可以对不含geometry类型的pgsql库表生效
CREATE JOB pg_szt_cdc
ON STREAMING
FROM POSTGRES (
"jdbc_url" = "jdbc:postgresql://192.168.1.100:5432/test",
"driver_url" = "postgresql-42.7.x.jar",
"driver_class" = "org.postgresql.Driver",

"user" = "doris_cdc",
"password" = "你的密码",
"database" = "test",
"schema" = "public",
"include_tables" =
"person,people",
"table.person.exclude_columns" = "name",
"table.people.exclude_columns" = "name",
"offset" = "initial"

)
TO DATABASE szt_ods (
"table.create.properties.replication_num" = "1"
);

以下排除可以对含geometry类型的pgsql库表不生效,无法正常执行
CREATE JOB pg_szt_cdc
ON STREAMING
FROM POSTGRES (
"jdbc_url" = "jdbc:postgresql://192.168.1.100:5432/test",
"driver_url" = "postgresql-42.7.x.jar",
"driver_class" = "org.postgresql.Driver",

"user" = "doris_cdc",
"password" = "你的密码",
"database" = "test",
"schema" = "public",
"include_tables" =
"building",
"table.building.exclude_columns" = "geometry",
"offset" = "initial"

)
TO DATABASE szt_ods (
"table.create.properties.replication_num" = "1"
);

building表结构如下:
/*
Navicat Premium Data Transfer

Source Server : 192.168.1.100test
Source Server Type : PostgreSQL
Source Server Version : 160013 (160013)
Source Host : 192.168.1.100:5432
Source Catalog : tp_szt
Source Schema : public

Target Server Type : PostgreSQL
Target Server Version : 160013 (160013)
File Encoding : 65001

Date: 03/09/2026 17:06:05
*/


-- Table structure for building


DROP TABLE IF EXISTS "public"."building";
CREATE TABLE "public"."building" (
"id" int8 NOT NULL,
"buildingid" int8 NOT NULL,
"buildingdata" jsonb,
"buildingclass" int8,
"buildingname" varchar(255) COLLATE "pg_catalog"."default",
"geometry" geometry(GEOMETRYCOLLECTION, 4326),
"create_by" varchar(32) COLLATE "pg_catalog"."default",
"create_time" timestamp(6),
"update_by" varchar(32) COLLATE "pg_catalog"."default",
"update_time" timestamp(6),
"processdata" jsonb,
"lng" numeric(16,8),
"lat" numeric(16,8)
)
;
COMMENT ON COLUMN "public"."building"."buildingid" IS '3D建筑模型的ID';
COMMENT ON COLUMN "public"."building"."buildingdata" IS '3D建筑模型的geojosn数据';
COMMENT ON COLUMN "public"."building"."buildingclass" IS '类别';
COMMENT ON COLUMN "public"."building"."buildingname" IS '3D建筑模型的名称';
COMMENT ON COLUMN "public"."building"."geometry" IS '面数据';
COMMENT ON COLUMN "public"."building"."create_by" IS '创建人';
COMMENT ON COLUMN "public"."building"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."building"."update_by" IS '更新人';
COMMENT ON COLUMN "public"."building"."update_time" IS '更新时间';
COMMENT ON COLUMN "public"."building"."processdata" IS 'mvt数据';


-- Indexes structure for table building


CREATE INDEX "buildingid_building_index" ON "public"."building" USING btree (
"buildingid" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "geometry_building_index" ON "public"."building" USING gist (
"geometry" "public"."gist_geometry_ops_2d"
);
CREATE INDEX "id_building_index" ON "public"."building" USING btree (
"id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "st_buffer_building_index" ON "public"."building" USING gist (
st_buffer(geometry, 0::double precision) "public"."gist_geometry_ops_2d"
);


-- Primary Key structure for table building


ALTER TABLE "public"."building" ADD CONSTRAINT "building_origin_copy1_pkey" PRIMARY KEY ("id");

What You Expected?

能否调整排除优先级,让exclude_columns先与类型识别生效?
或者
对不支持或无法识别的数据类型统一默认为string,而不是直接失败?

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions